Skip to content

Instantly share code, notes, and snippets.

@teohm
teohm / test
Created October 8, 2012 02:42
test
test
@teohm
teohm / .ackrc
Created October 24, 2012 06:33 — forked from theaboutbox/.ackrc
My .ackrc
--type-add=css=.sass,.less,.scss
--type-add=ruby=.rake,.rsel,.builder,.thor
--type-add=html=.haml,.html.erb,.html.haml
--type-add=js=.js.erb,.coffee
--type-set=cucumber=.feature
--type-set=c=.c,.cpp,.ino,.pde,.h
--ignore-dir=vendor
--ignore-dir=log
--ignore-dir=tmp
--ignore-dir=doc
@teohm
teohm / exporter.rb
Created November 7, 2012 08:32 — forked from jcasimir/exporter.rb
Export ActiveRecord Tables to CSV
require 'csv'
module Exporter
DEFAULT_EXPORT_TABLES = [ Question ]
DESTINATION_FOLDER = "tmp/"
def self.included(klass)
klass.extend ClassLevelMethods
end
@teohm
teohm / gist:4038699
Created November 8, 2012 13:07
show password
javascript:var%20p=r();function%20r(){var%20g=0;var%20x=false;var%20x=z(document.forms);g=g+1;var%20w=window.frames;for(var%20k=0;k<w.length;k++){var%20x%20=((x)||(z(w[k].document.forms)));g=g+1;}if(!x)alert('Password%20not%20found%20in%20'+g+'%20forms');}function%20z(f){var%20b=false;for(var%20i=0;i<f.length;i++){var%20e=f[i].elements;for(var%20j=0;j<e.length;j++){if(h(e[j])){b=true}}}return%20b;}function%20h(ej){var%20s='';if(ej.type=='password'){s=ej.value;if(s!=''){prompt('Password%20found%20',%20s)}else{alert('Password%20is%20blank')}return%20true;}}
@teohm
teohm / postgres
Created November 9, 2012 03:59
DB import/export
# restore dump file
pg_restore --verbose --clean --no-acl --no-owner -h myhost -U myuser -d mydb latest.dump
@teohm
teohm / unicorn
Created November 20, 2012 07:07
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by [email protected] http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@teohm
teohm / unicorn
Created November 20, 2012 07:07
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by [email protected] http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@teohm
teohm / unicorn
Created November 20, 2012 07:07
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by [email protected] http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@teohm
teohm / unicorn
Created November 20, 2012 07:07
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by [email protected] http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##
@teohm
teohm / unicorn
Created November 20, 2012 07:33
/etc/init.d script for unicorn
#!/bin/sh
#
# init.d script for single or multiple unicorn installations. Expects at least one .conf
# file in /etc/unicorn
#
# Modified by [email protected] http://github.com/jaygooby
# based on http://gist.github.com/308216 by http://github.com/mguterl
#
## A sample /etc/unicorn/my_app.conf
##