Skip to content

Instantly share code, notes, and snippets.

View cafedomingo's full-sized avatar

Patrick Sunday cafedomingo

  • 16:02 (UTC -07:00)
View GitHub Profile
@cafedomingo
cafedomingo / keybase.md
Created September 22, 2019 19:11
Keybase proof

Keybase proof

I hereby claim:

  • I am cafedomingo on github.
  • I am cafedomingo (https://keybase.io/cafedomingo) on keybase.
  • I have a public key ASBhaYp3Vvk5tOWwTVhNY_9KUZ61B40958b-Th7AQvo4Ego

To claim this, I am signing this object:

@cafedomingo
cafedomingo / RunOnceFactory.js
Created October 15, 2010 22:28
Takes a function and returns a function that will only be run once.
runOnce = function( func ) {
return ( function() {
var hasRun = false;
return function() {
if ( !hasRun )
{
hasRun = true;
func.apply( this, arguments );
}
};
serializeToQueryString(obj, props)
{
var params = [];
for(prop in obj)
{
if(obj.hasOwnProperty(prop)
&& (!(props instanceOf Array) || props.indexOf(prop) >= 0)
{
params.push(prop + "=" encodeURIComponent(obj[prop]));
}