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
@bingeboy
bingeboy / VLC SUBTITLE DISABLE
Last active August 29, 2015 14:03
Hack to turn off VLC2 on OSX Subtitles
#Hack to turn off VLC2 Subtitles on OSX.
````
% vim /Applications/VLC.app/Contents/MacOS/include/vlc/libvlc_media_player.h +1014
```
Commentout the line you are on in VIM.
```
* LIBVLC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
@bingeboy
bingeboy / curl.js
Created May 21, 2014 17:52
Curl request in node
var options = {
url: 'https://example.foxycart.com/api',
form: {
api_token:'PUT_YOUR_API_KEY_HERE',
api_action:'subscription_datafeed'
},
method: 'POST'
};
request(options, function (error, response, body) { });
@bingeboy
bingeboy / hapiHandler.js
Last active August 29, 2015 14:01
example of a hapi handler
var Hapi = require('hapi');
var server = new Hapi.Server();
// Handler in top level
var status = function () {
this.reply('ok');
};
@bingeboy
bingeboy / pubsub
Created May 10, 2014 06:26
pubsub prototype pattern js
var PubSub = function() {};
//this will store the callback into the topics array
PubSub.prototype.subscribe = function( topic, callback, context) {
context = context || this;
this._topics = this._topics || {};
this._topics[topic] = this._topics.topic || [];
this._topics[topic].push({ "content", context, "callback", callback });
}
@bingeboy
bingeboy / gist:11265706
Created April 24, 2014 19:03
IP and weather bash profile
#Welcome Screen
echo "$(tput setaf 2)
`date +"%A, %e %B %Y, %X %Z"`
$(tput setaf 1)IP Addresses.......: $(tput setaf 6)`ipconfig getifaddr en0` and `wget -q -O - http://icanhazip.com/ | tail`
$(tput setaf 1)Weather............: $(tput setaf 3)Brooklyn `curl -s "http://rss.accuweather.com/rss/liveweather_rss.asp?metric=211&LOCCODE=11211" | sed -n '/Currently:/ s/.*: \(.*\): \([0-9]*\)\([CF]\).*/\2°\3, \1/p'`
$(tput sgr0)"
@bingeboy
bingeboy / help
Created April 21, 2014 15:47
help commands for bot
[11:32am] fewd: Hello
[11:33am] You are now known as JP.
[11:37am] prood joined the chat room.
[11:37am] prood: thanks, JP
[11:38am] JP: nice
[11:38am] JP: no bot yet… i had a some maverick growing pains
[11:38am] prood: this is cool for now
[11:41am] Hubot joined the chat room.
[11:41am] JP: why hello hubot
[11:41am] prood: welcome Hubot
@bingeboy
bingeboy / ngircd.conf
Last active August 29, 2015 13:59
ngirc config
# BETA
# [server] commented out.
# This is a sample configuration file for the ngIRCd IRC daemon, which must
# be customized to the local preferences and needs.
#
# Comments are started with "#" or ";".
#
# A lot of configuration options in this file start with a ";". You have
# to remove the ";" in front of each variable to actually set a value!
# The disabled variables are shown with example values for completeness only
@bingeboy
bingeboy / testResults.md
Last active August 29, 2015 13:58
Express vs Restify Apache Benchmark Results

#Express vs Restify Apache Benchmark Results

###Test

$ ab -n 10000 -c 100 http://localhost:3000/

###Versions Details node v0.10.26

@bingeboy
bingeboy / abtest
Created April 8, 2014 05:40
Apache AB benchmark test
#if you are on osx and use brew tap formula needed.
$ ab -n 10000 -c 100 http://yahoo.com/
# this will make 10,000 requests with 100 concurrent connections.
@bingeboy
bingeboy / nodeInstallMake
Created March 28, 2014 17:51
How to install nodejs on ARM chipset
$ cd /opt/node
#if don't have that dir created yet
$ mkdir -p /opt/node
$ wget http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
$ tar -xvf node-v0.10.26.tar.gz
$ cd node-v0.10.26
$ ./configure
$ sudo make
# note above make takes forever to build
$ sudo make install