Skip to content

Instantly share code, notes, and snippets.

View bingeboy's full-sized avatar
🏠
Working from home

JP McGarrity bingeboy

🏠
Working from home
View GitHub Profile
[ { created_at: 'Mon Feb 29 23:08:54 +0000 2016',
id: 704443254360580100,
id_str: '704443254360580096',
text: 'HOW TO POST UP AT DA CLUB @GwenStefani @VanityFair https://t.co/4lpcSrMjVZ',
truncated: false,
source: '<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>',
in_reply_to_status_id: null,
in_reply_to_status_id_str: null,
in_reply_to_user_id: null,
in_reply_to_user_id_str: null,
@bingeboy
bingeboy / install.sh
Created January 25, 2016 21:08
how to install npm without nodejs package.
curl -k -L https://npmjs.org/install.sh | sh
@bingeboy
bingeboy / payloadfs.js
Last active January 20, 2016 21:17
write a payload from flux to temp folder
/////////////////////////////////////////////////////////////////////////////////////
// TEST CODE FOR PAYLOAD DATA CREATION
/////////////////////////////////////////////////////////////////////////////////////
var fs = require('fs');
var fileName = '/tmp/results.json';
fs.writeFile( fileName, JSON.stringify(res.body, null, 4), function (error) {
if (error) {
console.log(error);
} else {
console.log('JSON saved to temp dir: ', fileName);
@bingeboy
bingeboy / git flow thing at office
Created December 16, 2013 17:08
REPOSA SPECIAL
$ git reset --hard
$ git pull
#might be aske to merge and leave a comment.... this defualt in osx is vim so type" :wq" to write and then quit vim.
$ git push <-- if you had anything commited you wanted to push the the repo.
var memoize = {
keys:{},
set: function(key, value) { // set a key, value pair, return value
this.keys[key] = value;
return value;
},
clear: function( ) {
this.keys = {}; // set in memoize keys, and return result
return this.key;
@bingeboy
bingeboy / Array Clone Prototype
Created October 28, 2013 19:11
Array Clone Prototype
Array.prototype.clone = function() {
return this.slice(0);
};
@bingeboy
bingeboy / Nodejs module Class pattern
Created October 26, 2013 16:27
Nodejs module Class pattern
// Constructor
function Foo(bar) {
// always initialize all instance properties
this.bar = bar;
this.baz = 'baz'; // default value
}
// class methods
Foo.prototype.fooBar = function() {
};
@bingeboy
bingeboy / String.prototype.repeat
Created October 19, 2013 07:42
String.prototype.repeat
String.prototype.repeat = function (count) {
var sDiff = "", sBase2 = count > 0 ? this.valueOf() : "";
for (var nMask = count; nMask > 1; nMask >>= 1) {
if (nMask & 1) { sDiff += sBase2; }
sBase2 += sBase2;
}
return sBase2 + sDiff;
};
@bingeboy
bingeboy / sshconfig
Created September 6, 2013 03:43
~/.ssh/config
ControlMaster auto
ControlPath /tmp/%r@%h:%p
ControlPersist yes
@bingeboy
bingeboy / .osx
Created August 30, 2013 20:36
Always asks for password
#!/bin/bash
# ~/.osx — http://mths.be/osx
# Ask for the administrator password upfront
#sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
#while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &