This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Here is a proposal for minimalist JavaScript classes, humbly offered. | |
| // There are (at least) two different directions in which classes can be steered. | |
| // If we go for a wholly new semantics and implementation, then fancier classical | |
| // inheritance can be supported with parallel prototype chains for true inheritance | |
| // of properties at both the class and instance level. | |
| // If however, we keep current JavaScript prototype semantics, and add a form that | |
| // can desugar to ES3, things must necessarily stay simpler. This is the direction | |
| // I'm assuming here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| with application | |
| set env to production | |
| set view engine to jade | |
| get /user/tj | |
| send "hello" | |
| delete /user/tj | |
| send "no can do!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function hasOwnProperty(key) { | |
| if(this[key]) { | |
| var proto = this.prototype; | |
| if(proto) { | |
| return ((key in this.prototype) && (this[key] === this.prototype[key])); | |
| } | |
| return true; | |
| } else { | |
| return false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ---------- Forwarded message ---------- | |
| From: Mark S. Miller <erights@google.com> | |
| Date: Tue, Nov 16, 2010 at 3:44 PM | |
| Subject: "Future of Javascript" doc from our internal "JavaScript Summit" | |
| last week | |
| To: javascript-standard@google.com | |
| On November 10th and 11th, a number of Google teams representing a variety | |
| of viewpoints on client-side languages met to agree on a common vision for | |
| the future of Javascript. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Exec { | |
| path => [ | |
| '/usr/local/bin', | |
| '/usr/local/sbin', | |
| '/usr/bin/', | |
| '/usr/sbin', | |
| '/bin', | |
| '/sbin'], | |
| logoutput => true, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This example adapted from Matt Gallagher's "Minimalist Cocoa Programming" | |
| // blog article: | |
| // http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html | |
| var $ = require('NodObjC') | |
| $.import('Cocoa') | |
| var pool = $.NSAutoreleasePool('alloc')('init') | |
| , app = $.NSApplication('sharedApplication') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var vows = require('vows'), | |
| assert = require('assert'); | |
| function wait(callback) { | |
| setTimeout(function() { | |
| callback('hello', 'world'); | |
| }, 2000) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Basic usage | |
| _.icon('home', 'home-id-selector') | |
| // Advanced usage | |
| _.icon('power', 'start-menu-icon', { | |
| fill : { | |
| fill : "#333", | |
| stroke : "none" | |
| }, | |
| none : { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bradley@macaroon:~$ cat Documents/issues/ping_domain_socket.js | |
| var socket = './'+process.argv[2]; | |
| var http = require('http'); | |
| var req = http.request({ | |
| socketPath:socket, | |
| path:'/', | |
| method:'POST' | |
| }) | |
| setInterval(function(){req.write(process.argv[3])},1000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * | |
| * coderwall.js | |
| * | |
| * Code to display coderwall.com badges | |
| * | |
| */ | |
| var coderwallJSONurl ="http://www.coderwall.com/hermanjunge.json?callback=?"; | |
| var height = 75; |