Category Archives: Tutorials - Page 2

js2coffee.org helps your learn coffeescript faster

coffeescript icon
coffeescript icon

Coffee-script is a smoking hot simple language that converts 100% into Javascript code. Coffee-script allows you to spend more time focusing on the algorithm rather than the syntax.
js2coffee.org is an awesome website that converts your Coffee-script to Javascript and vice versa on the fly. So you can learn Coffee-script faster.
Example:
Let’s convert my Random Number Generator code from a previous post to Coffee-script.

// Javascript version
var getRandomNum = function( i, decLen ){
	return (Math.random() * (i||1) ).toFixed(decLen);
};

# My Coffee-script version
getRandomNum = ( i=1, decLen ) -> (Math.random()*i).toFixed(decLen)

# js2coffee.org Coffee-script verison
getRandomNum = (i, decLen) ->
	(Math.random() * (i or 1)).toFixed decLen

Awesome huh?

Check out a demo of Coffeescript here.

I’ll like to leave you with a HTML5 Coffee-script presentation.

Cheers.

Simple fix for MSI Windows Installer Error

Here’s a quick post over how to install applications that encounter the Windows Installer Error.


Error Message:

Windows Installer
This installation package could not be opened.
Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package.

Alternative Solutions not presented in the video.
1) Avoid msi files and go for an alternative file format to install your application.
2) Install the application using the hidden Administrator account.
Here’s a Guide
3) Reinstall Windows on your computer.
4) Re-download the file from a different website.
5) System Restore to a period where the problem didn’t exist.
6) Extract the content of the MSI file and run the executable from there.
Extract MSI contents.batch

REM Extracts the filename.msi file to C:\extracted_files
msiexec /a filename.msi /qb TARGETDIR=C:\extracted_files

Check out this awesome Coffeescript Tutorial


http://bodil.github.com/coffeescript/

How to install Docco.coffee on Windows 7

Docco.coffee requires the following to run.

  1. Node.js
  2. Python
  3. CoffeeScript
  4. Pygments
  5. Docco

Step 1:
Download and install Node.js and Python 2.7. Python 3.2 might work but I haven’t yet tried it out.

Step 2:
Add the root and ‘node_modules’ directories for node.js and the root and “Script” directory for python 2.7 to your path environment variable.
C:\nodejs;%userprofile%\node_modules\.bin;C:\python27;C:\Python27\Scripts;

Step 3:
Open up a command prompt, start -> run -> type “cmd”.

Type npm install coffee-script
*You should see installation output on the screen*

Type npm install docco
*You should see installation output on the screen*

Step 4:
Download ez_setup
In command prompt, navigate to where you downloaded ez_setup.py.
Type in python ez_setup.py.

Step 5:
In command prompt type easy_install pygments to install Pygments.

Done.

Test
Download ‘underscore.js’ to your desktop.

Open up a command prompt and type in docco %userprofile%\desktop\underscore.js.
You should see two output files, “p” and “docs”.
The annotated source code is the html file in the docs folder.

Enjoy!

Bad Behavior has blocked 1086 access attempts in the last 7 days.

FireStats icon Powered by FireStats