Skip to content

Instantly share code, notes, and snippets.

require 'rubygems'
gem 'sequel', '= 3.0.0'
gem 'sinatra', '= 0.9.2'
require File.dirname(__FILE__) + '/lib/taps/config'
Taps::Config.database_url = ENV['DATABASE_URL'] # production db
Taps::Config.taps_database_url = ENV['TAPS_DATABASE_URL'] # db for taps
Taps::Config.login = 'myserverlogin'
$ psql
=# create table bigtable ( id bigserial, name text );
NOTICE: CREATE TABLE will create implicit sequence "bigtable_id_seq" for serial column "bigtable.id"
CREATE TABLE
=# \d bigtable
Table "public.bigtable"
Column | Type | Modifiers
--------+--------+-------------------------------------------------------
id | bigint | not null default nextval('bigtable_id_seq'::regclass)
name | text |
26 minutes ago
@natfriedman: Heroku looks amazing, but the pricing is awful. I wish I could get their deployment architecture on my own servers.
9 minutes ago
@natfriedman: Oh my god, I take it all back. Heroku is so wonderful I just started crying a little bit. This is worth the money.
require 'sinatra'
get '/' do
headers['Cached-Control'] = 'public, max-age=60'
Time.now.to_s
end
run Sinatra::Application
[color]
diff = auto
status = auto
branch = auto
[alias]
st = status
ci = commit
co = checkout
@ricardochimal
ricardochimal / gist:293517
Created February 3, 2010 09:48
256 color bash prompt
function smart_pwd {
local pwdmaxlen=25
local trunc_symbol=".."
local dir=${PWD##*/}
local tmp=""
pwdmaxlen=$(( ( pwdmaxlen < ${#dir} ) ? ${#dir} : pwdmaxlen ))
NEW_PWD=${PWD/#$HOME/\~}
local pwdoffset=$(( ${#NEW_PWD} - pwdmaxlen ))
if [ ${pwdoffset} -gt "0" ]
" comment an entire visual block at once
" highlight the area however you want (V, CTRL+V) then
" ,c will comment the block
" ,u will uncomment the block
let b:comment_leader = '# '
au FileType haskell,vhdl,ada let b:comment_leader = '-- '
au FileType vim let b:comment_leader = '" '
au FileType c,cpp,java,php,js let b:comment_leader = '// '
au FileType sh,make,perl,ruby,python let b:comment_leader = '# '
au FileType tex let b:comment_leader = '% '
@ricardochimal
ricardochimal / cert.rb
Created May 10, 2011 18:49
generating ssl certs with subjectAltName domains
domain = "*.example.com"
subjectAltDomains = [ domain, "example.com" ]
require 'openssl'
puts "Generating public and private keys..."
key = OpenSSL::PKey::RSA.new(2048)
subject = "/C=US/ST=California/L=Los Angeles/O=Example Inc./CN=#{domain}"
cert = OpenSSL::X509::Certificate.new
@ricardochimal
ricardochimal / notes.md
Created September 6, 2011 04:56 — forked from uasi/vim.rb
Vim formula for Homebrew
 $ brew install python --framework
 $ mkdir ~/Library/Frameworks/
 $ cd ~/Library/Frameworks/
 $ ln -s /usr/local/Cellar/python/2.7.2/Frameworks/Python.framework .
 $ brew install -vd ./vim.rb
http://dealspl.us/souplantation-coupons/424752p