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
// The main node process | |
// Will output to shell: | |
// { | |
// "test": "test" | |
// } | |
// "bam" | |
var worker = require('./webworker'), | |
sys = require('sys'); |
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
// An example biggle module / plugin | |
// __init is called by plugin loader, with the global biggie object as first parameter. | |
exports.__init = function(big) { | |
// We can then mix in the global stuff from the biggie object | |
process.mixin(big.global); | |
// This will contain all the stuff we want to export as a plugin | |
var exports = {}; |
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
Get(/^\/myroute/, function(request) { | |
... | |
}); | |
Post(/^\/myroute/, function(request) { | |
... | |
}); | |
Head(/^\/myroute/, function(request) { |
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
HTTP({ | |
host: '127.0.0.1', | |
post: 8000, | |
routes: [{ | |
match: /^\/myroute/, | |
callback: function(request) {} | |
}, { | |
match: { | |
type: 'POST', | |
rule: /^\/myroute/ |
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 sys = require("sys"), | |
http = require("http"); | |
var google = http.createClient(80, "www.google.com"); | |
var request = google.request("GET", "/", {"host": "www.google.com"}); | |
request.addListener('response', function (response) { | |
response.setBodyEncoding("utf8"); | |
var body = ''; |
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
// ==UserScript== | |
// @name Export Github Issues | |
// @namespace http://userscripts.org/users/tim | |
// @description Can export issues by state and label | |
// @include http://github.com/*/issues* | |
// ==/UserScript== | |
(function() { | |
var GITHUB_API_URL, GithubRequest, URL_EXPRESSION, formatOutput, menuCallback, repo, url, user; | |
URL_EXPRESSION = /^.*\/(.*?)\/(.*?)\/issues.*$/; | |
GITHUB_API_URL = 'http://github.com/api/v2/json'; |
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
+ (id)boxEnclosingView:(CPView)aView | |
{ | |
var box = [[self alloc] initWithFrame:CGRectMakeZero()], | |
enclosingView = [aView superview]; | |
[box setFrameFromContentFrame:[aView frame]]; | |
[enclosingView replaceSubview:aView with:box]; | |
[box setContentView:aView]; |
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 server = require('hookio'); | |
server.init(); |
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
Fornode extends BaseNode: -> | |
# Contructor | |
ForNode::compile: (source) -> | |
source |
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
class B extends A | |
constructor: -> | |
@where_am_i: 'at work' | |
sayWhereYouAre: -> | |
alert 'I am ' + @where_am_i |