Skip to content

Instantly share code, notes, and snippets.

View tanepiper's full-sized avatar

Tane Piper tanepiper

View GitHub Profile
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active November 24, 2025 23:57
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@Raynos
Raynos / delayed-computation.md
Last active March 19, 2019 00:01
Delayed computation

Programming with delayed computation

A delayed computation is a function that will do some computation when called. Because of the delayed nature the computation may be asynchronous so the function takes a callback.

Note: the term "delayed computation" is just a temporary name so we can talk about this idea, I do not recommend using this name as it's a) confusing and b) this concept is hard to name.

@juliangruber
juliangruber / gist:5115813
Created March 8, 2013 11:22
How to create flamegraphs from the multilevel benchmark. You need to be running an OS that supports dtrace and the ustack helpers, which is not the case for Mac OS X. I created a joyentcloud smartos instance for getting the output.
git clone git://github.com/juliangruber/multilevel.git
cd multilevel
npm install
# comment out lines 19-25 in bench.js and add underneath: fakeNetwork(1e6, log);
node bench.js &
# make sure no other node process is running now
dtrace -n 'profile-97/execname == "node" && arg1/{@[jstack(150, 8000)] = count(); } tick-60s { exit(0); }' > stacks.out
# kill the node bench.js process
@millermedeiros
millermedeiros / example.js
Last active September 10, 2022 03:06
execute multiple shell commands in series on node.js
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');
}});
define([
'vent',
'routers/manage/groups',
'routers/manage/learners',
'controllers/manage/groups',
'controllers/manage/learners',
'views/layouts/manage/module',
'views/tab/collection',
'collections/client/tab'
], function (
@lightyrs
lightyrs / Custom.css
Created December 17, 2012 08:26
My Chrome Dev Tools Skin incorporates the sleek visual style of codepen.io with some of my own usability enhancements. Pictured here with Monokai color scheme ( http://imgur.com/mbrqt ).
/*
Chrome Developer Tools - Monokai Color Theme
Author: Béres Máté Csaba / bjmatt.com / @bjmatt / [email protected]
-----------------------------------------------------------------------------------------------------------
Installation:
1. Find your Chrome's user stylesheets directory:
@tanepiper
tanepiper / HighResolutionTimer.js
Created December 5, 2012 13:47
A high resolution timer, set the tick duration (default 1s) and callback to be actioned on each tick - accurate to within ~1-5ms per tick and compensates automatically for drift over time.
var HighResolutionTimer = window.HighResolutionTimer = window.HighResolutionTimer || (function() {
var HighResolutionTimer = function(options) {
this.timer = false;
this.total_ticks = 0;
this.start_time = undefined;
this.current_time = undefined;
@jasonrudolph
jasonrudolph / 00-about.md
Created September 21, 2012 18:42
Rough Notes from Strange Loop 2012
/*
* Javascript EXIF Reader 0.1.4
* Copyright (c) 2008 Jacob Seidelin, [email protected], http://blog.nihilogic.dk/
* Licensed under the MPL License [http://www.nihilogic.dk/licenses/mpl-license.txt]
*/
var EXIF = {};
(function() {