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
<?php | |
header("content-type: application/json"); | |
$output = array("classes" => array(0, 1, 2, 3, 4), "rooms" => array(0, 1, 2, 3, 4)); | |
echo json_encode($output); // {"classes":[0,1,2,3,4],"rooms":[0,1,2,3,4]} |
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/lib/stickshift/{REDACTED}/app-root/data/bin/node: line 3: 12992 Segmentation fault NODE_PATH=$OPENSHIFT_DATA_DIR/lib/node_modules PORT=$OPENSHIFT_INTERNAL_PORT C9_PORT=$OPENSHIFT_INTERNAL_PORT IP=$OPENSHIFT_INTERNAL_IP HOME=$OPENSHIFT_DATA_DIR $OPENSHIFT_DATA_DIR/bin/node-openshift "$@" |
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
socket.on('ping', function(fn) { | |
_.isFunction(fn) && fn(Date.now()); | |
}); |
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
npm info it worked if it ends with ok | |
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', '-ddd', 'install', 'julius' ] | |
npm info using npm@1.2.14 | |
npm info using node@v0.10.0 | |
npm verb node symlink /usr/bin/node | |
npm verb read json /home/skeggse/repos/package.json | |
npm WARN package.json home-pi@0.0.1 No README.md file found! | |
npm verb read json /home/skeggse/repos/node_modules/colors/package.json | |
npm verb read json /home/skeggse/repos/node_modules/express/package.json | |
npm verb read json /home/skeggse/repos/node_modules/imap/package.json |
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
!!!5 | |
html(lang="en") | |
head | |
title= title | |
link(rel='stylesheet', type='text/css', href='/stylesheets/style.css') | |
body | |
#account_manager | |
#sign_in Sign in | |
#sign_up Sign up | |
#top |
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 dgram = require('dgram'); | |
var _ = require('underscore'); | |
var thumbs = { | |
twiddle: function() {} | |
}; | |
_.mixin({ | |
options: function(self, options, defaults) { | |
if (options) |
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
function factorial(n) { | |
if (n == 0) | |
return 1; | |
return n * factorial(n - 1); | |
} | |
function factorialb(n) { | |
var b = 1; | |
while (n) | |
b *= n--; |
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 net = require('net'); | |
var util = require('util'); | |
var Writable = require('stream').Writable; | |
/** | |
* Pretends to consume the data written to it. In reality, it just eats data | |
* really slowly. | |
* | |
* @constructor | |
* @extends Writable |
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 net = require('net'); | |
var EventEmitter = require('events').EventEmitter; | |
// just define this in the file scope, you don't need to assign it as a property | |
var numApples = 50; | |
// pickers, because this can handle multiple pickers | |
var fruitPickers = new EventEmitter(); | |
// replentish apples every thirty seconds |
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 numApples = 5; | |
function handleConn(name) { | |
var pickedApples = 0; | |
return function pick() { | |
pickedApples++; | |
numApples--; | |
console.log(name, 'has', pickedApples, 'apples'); | |
}; |
OlderNewer