Skip to content

Instantly share code, notes, and snippets.

Keith Rosenberg netpoetica

Block or report user

Report or block netpoetica

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fractals.asm.js
fractalModule =function(stdlib){
"use asm";
var pow = stdlib.Math.pow;
var abs = stdlib.Math.abs;
var atan2 = stdlib.Math.atan2;
var cos = stdlib.Math.cos;
var sin = stdlib.Math.sin;
function mandlebrot(cx, cy, maxIter) {
cx = +cx;
cy = +cy;
kana / lazy.js
Created Apr 9, 2013
Lazy evaluation in JavaScript
View lazy.js
function delay(expressionAsFunction) {
var result;
var isEvaluated = false;
return function () {
if (!isEvaluated)
result = expressionAsFunction();
return result;
View our_setup_script.js
db = db.getSisterDB("config");
var mongosConn = db; // assume we connected to a mongos to get going
var res = null;
function check() {
if( !res || !res.ok ) {
throw "check(): not ok, stopping";
jpattishall / TouchTimerWorkaround.js
Last active Jan 26, 2018
setTimeout workaround for iPad and iOS6
View TouchTimerWorkaround.js
Workaround for iOS 6 setTimeout bug using requestAnimationFrame to simulate timers during Touch/Gesture-based events
Author: Jack Pattishall (
This code is free to use anywhere (MIT, etc.)
Note: UIWebView does not support requestAnimationFrames. If your timer is failing during a scroll event,
take a look at for a potential workaround.
Usage: Pass TRUE as the final argument for setTimeout or setInterval.
kTmnh / ios6-timers.js
Last active Dec 12, 2019 — forked from ronkorving/ios6-timers.js
iOS6 webkit timer bug workaround
View ios6-timers.js
(function (window) {
// This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6.
// iOS6 suffers from a bug that kills timers that are created while a page is scrolling.
// This library fixes that problem by recreating timers after scrolling finishes (with interval correction).
// This code is free to use by anyone (MIT, blabla).
// Original Author:
var timeouts = {};
var intervals = {};
var orgSetTimeout = window.setTimeout;
var orgSetInterval = window.setInterval;
potix2 / gist:3339485
Created Aug 13, 2012
View gist:3339485
% ab -n 10 -c 10 -p json.file -T "application/json; charset=utf-8" http://localhost/
View Node.js Stability Ratings
Stability ratings: 0-5
0 - Deprecated. This feature is known to be problematic, and changes are
planned. Do not rely on it. Use of the feature may cause warnings. Backwards
compatibility should not be expected.
1 - Experimental. This feature was introduced recently, and may change
or be removed in future versions. Please try it out and provide feedback.
If it addresses a use-case that is important to you, tell the node core team.
markdaws / common.js
Created Feb 7, 2012
Example of how to share JavaScript between client and node.js
View common.js
// common.js ======================================
(function(exports) {
// Define all your functions on the exports object = function() {
return 'bar';
})((typeof process === 'undefined' || !process.versions)
oslego / javascript_multiton.js
Created Jun 3, 2011
JavaScript Multiton Example
View javascript_multiton.js
Use, reuse but don't abuse!
Author: Razvan Caliman (
This is an example of a "Multiton" pattern;
Create a fixed number of instances of a class.
Use "lazy instantiation" to create objects only if needed.
If the maximum number of instances has been reached, return a random one from the ones created.
creationix / chatServer.js
Created Nov 19, 2010
A simple TCP based chat server written in node.js
View chatServer.js
// Load the TCP Library
net = require('net');
// Keep track of the chat clients
var clients = [];
// Start a TCP Server
net.createServer(function (socket) {
// Identify this client
You can’t perform that action at this time.