This file contains 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
<script type="text/javascript" src="namespace.js"></script> | |
<script type="text/javascript" src="example.module.js"></script> | |
<script type="text/javascript"> | |
console.log(example.module.test_fn("hello", "world")); | |
</script> |
This file contains 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
// Whisper.js | |
// A light-weight blog in node.js. | |
// Requires: | |
// http://github.com/ry/node_postgres.git | |
// http://github.com/chrisdickinson/pieshop.git | |
// http://github.com/chrisdickinson/postpie.git | |
// ..and JSDTL, but that's not publically available yet (sorry) | |
// Licensed under the BSD. | |
/* |
This file contains 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
// modifying the calling function's context | |
// in javascript to emulate operator overloading OR: | |
// ... | |
// now you're thinking with portals | |
var sys = require('sys'); | |
var Toy = function() { | |
this.toyList = []; | |
}; |
This file contains 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
from dulwich import client | |
import paramiko | |
class ParamikoWrapper(object): | |
def __init__(self, host, command, username, port): | |
self.client = paramiko.SSHClient() | |
self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
self.client.connect(host, username=username) | |
self.streams = self.client.exec_command(command[0]) | |
self.write = self.streams[0].writelines | |
self.read = self.streams[1].readline |
This file contains 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
sys: require 'sys' | |
require './jsdocstring' | |
howdy: (lol) -> | |
"Well hello there, folks. I'm testing out my docString thing. | |
In coffeescript. | |
DocStrings are awesome." | |
lol |
This file contains 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 Difference = function(milliseconds) { | |
if(milliseconds instanceof Object) { | |
var output = 0; | |
output += milliseconds.days === undefined ? 0 : 86400000; | |
output += milliseconds.hours === undefined ? 0 : 3600000; | |
output += milliseconds.minutes === undefined ? 0 : 60000; | |
output += milliseconds.seconds === undefined ? 0 : 1000; | |
output += milliseconds.milliseconds === undefined ? 0 : milliseconds; | |
milliseconds = output; |
This file contains 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 forms = require('cruciform').forms; | |
var BlogAuthorForm = forms.form({ | |
'email':forms.EmailField({required:false}), | |
'type':forms.ChoiceField({ | |
'choices':{ | |
0:'Email Account', | |
1:'Reddit Account', | |
2:'Gmail Account' | |
}, |
This file contains 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 sys = require('sys'); | |
// | |
// Here's how prototypical inheritance works. | |
// | |
var Klass = function(val) { | |
this.value = val; | |
}; |
This file contains 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
Javascript.forEach('Pythonista') | |
================================ | |
An outline. | |
----------- | |
01. Intro | |
- Who this is for | |
- What this is | |
- Terms |
This file contains 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
// QuerySet inherits from EventEmitter, | |
// so the result of this method can be used like so: | |
// var result = qs.filter({'something__something':'something_else'}); | |
// result.on('data', function(result) { console.log(result); }); | |
// or: | |
// qs.filter({'something__something':'something_else'})(function(err, results) { | |
// !err && console.log(results); | |
// }); |