Skip to content

Instantly share code, notes, and snippets.

.btn-custom {
background-color: hsl(357, 59%, 43%) !important;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorStr="hsl(357, 59%, 63%)", endColorStr="hsl(357, 59%, 43%)");
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr="#D8696F", endColorStr="#AE2D33");
background-repeat: repeat-x;
}
@mchung
mchung / Procfile.dev
Created January 26, 2012 16:21
What did we do before Procfile?
web: bundle exec unicorn_rails -p $PORT -c ./config/unicorn.rb
pg: postgres -D /usr/local/var/postgres
log: tail -f -n 0 log/development.log
guard: bundle exec guard
memcache: /usr/local/bin/memcached -v
redis: redis-server /usr/local/etc/redis.conf
worker: bundle exec rake resque:work
@mchung
mchung / gist:1625690
Created January 17, 2012 08:41
Migrating data from Postgres 8.3 to Postgres 9.1 on Heroku
project $ heroku db:pull
Loaded Taps v0.3.23
Auto-detected local database: postgres://postgres@127.0.0.1/pg91-dev?encoding=utf8
Warning: Data in the database 'postgres://postgres@127.0.0.1/pg91-dev?encoding=utf8' will be overwritten and will not be recoverable.
[snip]
project $ heroku pg:promote HEROKU_SHARED_POSTGRESQL_PURPLE
project $ heroku db:push
@mchung
mchung / ssl+chrome.md
Created July 27, 2011 06:25
Setup Chrome w/ SSL
@mchung
mchung / has-sprockets.js
Created June 15, 2011 23:32
A note on sprockets
// Will include jquery. The newline matters.
//= require jquery
@mchung
mchung / pg_hstore_spec.rb
Created May 27, 2011 19:10
Pg Hstore Specs!
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
require 'active_record'
# The following initializer will load the necessary HStore modules with
# ActiveSupport.on_load(:active_record) in a Railtie
run_hstore_initializer
class Document < ActiveRecord::Base
end
@mchung
mchung / app.js
Created May 26, 2011 06:59
instant-eol code breakdown
var eol = {};
// For more information on this organizational pattern, refer to James Yu's
// blog post titled "A Backbone.js Tutorial with Rails (Part 1)" referenced
// in the README.
var App = {
Views: {},
Controllers: {},
Collections: {},
init: function() {
@mchung
mchung / picasaweb_download_client.rb
Created March 25, 2011 01:01
"Dammit, I can't believe Picasa requires me to download photos one by one. Someone needs to do something about that."
#!/usr/bin/env ruby
require "net/http"
require "rexml/document"
class PicasawebDownloadClient
PICASAWEB = "picasaweb.google.com"
# Will return a list of links to every photo in an album
@mchung
mchung / oauth-and-rails-in-5mins.markdown
Created March 16, 2011 02:13
Get started with OAuth and Rails in 5 minutes

Get started with OAuth and Rails in 5 minutes

Assumptions

Before you get started, I'm assuming you've got the following setup on your machine:

  • Rails-3
  • RVM

Create a new Rails-3 application

require "imgscalr-lib" # https://github.com/thebuzzmedia/imgscalr
require "jruby"
java_import "javax.imageio.ImageIO"
ImageIO.write(
com.thebuzzmedia.imgscalr.Scalr.resize(
ImageIO.read(java.io.File.new("iss.jpg")),
250),
"jpg",
java.io.File.new("iss_new.jpg"))