Skip to content

Instantly share code, notes, and snippets.

View makeusabrew's full-sized avatar
💭
I may be slow to respond.

Nick Payne makeusabrew

💭
I may be slow to respond.
View GitHub Profile
@JamieMason
JamieMason / escapedRx.js
Created January 12, 2012 09:33
Get a RegExp from an unescaped RegExp String
function escapedRx (text, flags)
{
return new RegExp(text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), flags || '');
}
@makeusabrew
makeusabrew / client.js
Created December 13, 2011 08:52
Asynchronous recursive self executing ping function
/**
* Assume our client object manages all communication with the server and other wonderful stuff
*/
var Client = function() {
var that = {};
that.ping = function(limit, cb) {
var results = [];
(function _doPing(iteration) {