Skip to content

Instantly share code, notes, and snippets.

@mmasashi
mmasashi / update_column_type.sql
Created October 22, 2013 20:18
How to change the column type for Redshift.
BEGIN;
LOCK table_name;
ALTER TABLE table_name ADD COLUMN column_new column_type;
UPDATE table_name SET column_new = column_name;
ALTER TABLE table_name DROP column_name;
ALTER TABLE table_name RENAME column_new TO column_name;
END;
-- varchar -> integer
-- UPDATE cpvbeacon_dev SET column_new = CAST (nullif(column_name, '') AS INTEGER);
@amoslanka
amoslanka / Gemfile
Created December 13, 2012 21:19
Sprite Generation and Application in Rails
# etc ...
group :development do
# etc ...
# Sprites:
gem 'sprite-factory'
gem 'rmagick'
gem 'piet' # image optimization
end
@amoslanka
amoslanka / struck-postgres.md
Created August 3, 2012 15:43
Postgres in Struck Development

Postgres in Struck Development

Installation

Option 1: Postgres.app (recommended):

http://postgresapp.com/

Option 2: Install it yourself:
@coderoshi
coderoshi / Gemfile
Created May 24, 2012 16:55
A Sinatra example to turn any site into a JSON service
source :rubygems
gem 'sinatra'
gem 'httparty'
gem 'nokogiri'
@amoslanka
amoslanka / deploy.rb
Created March 20, 2012 18:16 — forked from netzpirat/deploy.rb
Capistrano recipe to sync rails database and files within a multi stage environment
set :sync_directories, ["public/assets", "public/galleries"]
set :sync_backups, 3
@scottlowe
scottlowe / etc_init.d_unicorn_example.co.uk
Created October 21, 2011 10:48
Ruby on Rails server setup on Ubuntu 11.04 with Nginx, Unicorn, Rbenv
#! /bin/bash
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn web server
# Description: starts unicorn
@chrisjacob
chrisjacob / README.md
Created September 1, 2011 12:08
Node.js Install + CoffeeScript + LESS (+TextMate Bundles)
@jasonroelofs
jasonroelofs / setup-statsd.sh
Created April 27, 2011 18:25 — forked from collegeman/setup-statsd.sh
Turn an Ubuntu 10.10 EC2 into a StatsD/Graphite server
# install git
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
# download the Node source, compile and install it
git clone https://github.com/joyent/node.git
cd node
./configure
make
sudo make install
# install the Node package manager for later use
@netzpirat
netzpirat / deploy.rb
Created May 14, 2009 10:06
Capistrano recipe to sync rails database and files within a multi stage environment
set :sync_directories, ["public/assets", "public/galleries"]
set :sync_backups, 3