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
// This supports: foo, foo.bar, foo.bar.baz (dot notation, | |
// like mongodb) and also passing in a custom accessor function | |
_get: function(o, accessor) { | |
var fn = accessor; | |
if (typeof(accessor) === 'string') { | |
fn = function(o) { | |
var keys = accessor.split(/\./); | |
_.each(keys, function(key) { | |
o = o[key]; |
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
#include <math.h> | |
#include <stdio.h> | |
#include <sys/time.h> | |
double microtime(); | |
// C version of bench from Bug 879891. 1 iteration completes in 0.17 seconds | |
void compute(int *image); |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Mandelbrot set with asm.js</title> | |
<meta charset="utf-8" /> | |
</head> | |
<body> | |
<canvas id="c"></canvas> | |
<div id="status"></div> | |
<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
# | |
# The MySQL database server configuration file. | |
# | |
# You can copy this to one of: | |
# - "/etc/mysql/my.cnf" to set global options, | |
# - "~/.my.cnf" to set user-specific options. | |
# | |
# One can use all long options that the program supports. | |
# Run program with --help to get a list of available options and with | |
# --print-defaults to see which it would actually understand and use. |
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 Thing() { | |
var self = this; | |
// Thing is now an event emitter/receiver | |
require('events').EventEmitter.call(self); | |
} | |
var thing = new Thing(); | |
thing.emit('foo'); |
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 res = // Any input stream | |
var out = fs.createWriteStream(localPath); | |
res.pipe(out); | |
var dead = false; | |
function die(err) { | |
if (!dead) { | |
dead = true; | |
res.end(); | |
out.end(); | |
return callback(err); |
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
alias gitc='git add -A . && git commit && git pull && git push' |
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
./symfony doctrine:build --all --db --env=prod | |
./symfony project:sync-content frontend prod from staging@staging | |
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
(cd /var/www/dukelist && ./app/console dukelist:cleanup --env=prod --send-emails) |
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
(cd /var/www/dukelist && ./app/console dukelist:cleanup --env=staging) | |