Skip to content

Instantly share code, notes, and snippets.

View barunio's full-sized avatar

Barun Singh barunio

View GitHub Profile
@barunio
barunio / self-signed-localhost-for-rails.txt
Last active March 10, 2017 04:07 — forked from webdevotion/self-signed-localhost-for-rails.txt
SSL self signed localhost for rails start to finish, no red warnings.
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@barunio
barunio / resque.rake
Created January 18, 2012 20:40 — forked from denmarkin/resque.rake
My rake task for clearing Resque queues and stats
# see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version
# see https://github.com/defunkt/resque/issues/49
# see http://redis.io/commands - new commands
namespace :resque do
desc "Clear pending tasks"
task :clear => :environment do
queues = Resque.queues
queues.each do |queue_name|
puts "Clearing #{queue_name}..."
@barunio
barunio / building_types.rb
Created September 16, 2011 17:35
building types
self.building_type =
if n_apartments < 5 then Z::MULTIFAMILY
elsif n_stories < 4 then Z::LOWRISE
elsif n_stories < 7 then Z::MIDRISE
elsif n_stories > 6 then Z::HIGHRISE
end
@barunio
barunio / gist:1169462
Created August 24, 2011 22:34 — forked from mnoble/gist:1168350
Command-Shift-ArrowKeys to vertical select in Vim
nmap <S-A-Up> <C-v><Up>
nmap <S-A-Down> <C-v><Down>
nmap <S-A-Left> <C-v><S-Left>
nmap <S-A-Right> <C-v><S-Right>
vmap <S-A-Left> <S-Left>
vmap <S-A-Right> <S-Right>
# key innodb settings to boost performance
# To install (root required):
# - shutdown mysql
# - linux: edit /etc/mysql/my.cnf, rm /var/lib/mysql/ib_logfile*
# - OS X: edit /etc/my.cnf, rm /usr/local/mysql/data/ib_logfile*
# - start mysql
# recommend 256-512M for development, use more if you have it. 75%+ for a dedicated db.
innodb_buffer_pool_size = 256M