This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'headless' | |
require 'selenium-webdriver' | |
Headless.ly(dimensions: "1920x1200x24") do | |
driver = Selenium::WebDriver.for :firefox | |
driver.navigate.to('http://hellohappy.org/beautiful-web-type/') | |
driver.save_screenshot('tmp/screenshot.png') | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Environment | |
class Grabber | |
include Environment | |
end | |
module_function | |
def get(key) | |
ENV[key.to_s.upcase] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
en-US: | |
welcome: "Welcome to %{app_name}!" | |
goodbye: "See ya later, %{name}. Come back to %{app_name} soon!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nevermind. Use Hombrew. | |
brew install heroku-toolbelt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# RBEnv | |
# | |
eval "$(rbenv init --no-rehash -)" | |
rbenv rehash > /dev/null 2<&1 &! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.9.3p327 :010 > helper.distance_of_time_in_words(Date.parse("Dec 12, 2012"), Date.parse("Jan 1, 2101")) | |
=> "about 88 years" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -n - associate standard input with /dev/null | |
# -N - just set up the tunnel and don't prepare a command stream | |
# -T - Don't allocate a psedo-tty on the remote system. | |
# -R - use a reverse tunnel | |
# | |
# [local port]:[local host]:[remote port] [remote host] | |
ssh -nNT -R 5000:local.mydomain.com:80 remote.server.host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://thoughtbot.com/bourbon | |
@import 'bourbon' | |
$gw-colmumn: 65 | |
$gw-gutter: 20 | |
@for $columns from 1 through 12 | |
.grid-#{$columns} | |
width: grid-width($columns) | |
.offset-#{$columns} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To upgrade or install PostgreSQL do following: | |
# | |
# brew unlink postgresql | |
# brew install https://raw.github.com/gist/3284212/ce728f1700665926be7a54987f31584dd9a3ca03/postgresql.rb | |
# | |
require 'formula' | |
class Postgresql < Formula | |
homepage 'http://www.postgresql.org/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/client.rb | |
class Client < ActiveRecord::Base | |
acts_as_whateverable | |
# ... | |
end |