Skip to content

Instantly share code, notes, and snippets.

View blaenk's full-sized avatar

Jorge Israel Peña blaenk

  • Los Angeles, California
  • 15:00 (UTC -07:00)
View GitHub Profile
@thbar
thbar / deploy.rb
Created September 7, 2010 18:18
Resque + god + capistrano recipe
# note - you may need to split into a before-deploy (stop) and after-deploy (start) depending on your setup
desc "Hot-reload God configuration for the Resque worker"
deploy.task :reload_god_config do
sudo "god stop resque"
sudo "god load #{File.join deploy_to, 'current', 'config', 'resque.god'}"
sudo "god start resque"
end
after 'deploy:update_code', 'deploy:update_shared_symlinks'
@lsbardel
lsbardel / redis-server-for-init.d-startup
Created December 15, 2009 21:01 — forked from mtodd/redis-server-for-init.d-startup
Init.d Redis script for Ubuntu
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@endolith
endolith / frequency_estimator.py
Last active February 26, 2025 04:36
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log, nonzero
from scipy.signal import blackmanharris, correlate
from time import time
import sys
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import flacread
@seven1m
seven1m / number_to_human_size.js
Created November 12, 2009 16:45
matching ruby and javascript methods for formatting bytes in human readable format
function number_to_human_size(size) {
if(size < 1024)
return size + ' bytes';
else if(size < 1024.0 * 1024.0)
return (size / 1024.0).toFixed(1) + ' KiB'
else if(size < 1024.0 * 1024.0 * 1024.0)
return (size / 1024.0 / 1024.0).toFixed(1) + ' MiB'
else
return (size / 1024.0 / 1024.0 / 1024.0).toFixed(1) + ' GiB';
}
@ArtemGr
ArtemGr / SCGI.java
Last active March 28, 2020 23:54
Java SCGI connector
/*
Copyright (c) 2008 ArtemGr
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR