Skip to content

Instantly share code, notes, and snippets.

View joemccann's full-sized avatar
💭
Thinking

Joe McCann joemccann

💭
Thinking
View GitHub Profile
@joemccann
joemccann / perl-fix.sh
Created July 8, 2012 18:25
Fixing the Stupid Perl Issues on Linux
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
apt-get install locales
dpkg-reconfigure locales
@joemccann
joemccann / playlist.md
Created June 25, 2012 20:09
Nodeconf 2012 DJ Playlist

Artist - Track Name

  • Phil Collins - In the Air Tonight
@joemccann
joemccann / dabblet.css
Created January 15, 2012 15:22
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
@joemccann
joemccann / redis-install.sh
Created December 11, 2011 03:12
redis-install
# You probably shouldn't use this
rm -f `which redis-server`
wget http://redis.googlecode.com/files/redis-2.4.10.tar.gz
tar -xf redis-2.4.10.tar.gz
cd redis-2.4.10
make && make install
@joemccann
joemccann / redis.conf
Created December 6, 2011 21:51
Standard Redis Conf with Authentication
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specifiy
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
@joemccann
joemccann / clicknorm.js
Created November 30, 2011 18:56
Normalize click handler
var clickType
function normalizeClick(){
try {
d.createEvent("TouchEvent")
clickType = 'touchend'
return true
}catch (e){
clickType = 'click'
return false
@joemccann
joemccann / bouncy.conf
Created November 30, 2011 18:05
Monit script for bouncy
check process node with pidfile /etc/init.d/bouncy.node.pid
start "/etc/init.d/yourApp start"
stop "/etc/init.d/yourApp stop"
if failed host 127.0.0.1 port 80
then restart
@joemccann
joemccann / f.sh
Created November 30, 2011 02:57
forever fails
forever start bouncy /var/www/subprint/server/configs/routes.json 80
@joemccann
joemccann / killer.sh
Created November 28, 2011 18:38
restart node 0.6.1+
kill -9 `ps -A | awk '/node/{print $1}'`
@joemccann
joemccann / up.js
Created November 18, 2011 16:02
upload express example
app.post('/upload/photo', function(req, res, next){
var json_response = {}
req.form.complete(function (err, fields, files){
if (err){
next(err)
}
else{
// temporary filename