For Mac and Windows users, just install Docker Toolbox. It provides what you need to get started, including:
class EventEmitter | |
constructor: -> | |
@events = {} | |
emit: (event, args...) -> | |
return false unless @events[event] | |
listener args... for listener in @events[event] | |
return true | |
addListener: (event, listener) -> |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.
In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.
While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.
Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more pu
// Node.js CheatSheet. | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html | |
#!/bin/sh | |
#--------------------------------- | |
# nodesupervisor Start/Stop Script | |
#--------------------------------- | |
#--------------------------------- | |
# chkconfig: 2345 99 99 | |
# description: NodeJS Supervisor | |
# -------------------------------- |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
(function($) { | |
$(document).ready(function(){ | |
$('#next').click(function(){ | |
$.post( | |
PT_Ajax.ajaxurl, | |
{ | |
// wp ajax action | |
action : 'ajax-inputtitleSubmit', | |
// vars |