Skip to content

Instantly share code, notes, and snippets.

View philtr's full-sized avatar

Phillip Ridlen philtr

View GitHub Profile
@philtr
philtr / userstyle.gmail-logo.css
Created November 3, 2011 16:53
Replace Gmail logo with your own
a#gbqlw,
a:hover#gbqlw,
.gbgt-hvr {
width: 128px;
height: 70px;
margin: 30px 0 0 0;
background-image: url(/* Your logo here*/) !important;
background-position: 0 center !important;
background-color: transparent !important;
background-repeat: no-repeat !important; }
@philtr
philtr / .zshrc
Created February 9, 2012 16:20
Shell function for creating a new empty branch
# Add this to your .zshrc or .bash_profile
# Usage: gneb BRANCH_NAME
#
function gneb {
git symbolic-ref HEAD refs/heads/$1
rm .git/index
git clean -fdx
touch README.md
git add README.md
git commit -m 'Initial commit'
@philtr
philtr / client.rb
Created April 16, 2012 20:12
Acts as Whateverable
# app/models/client.rb
class Client < ActiveRecord::Base
acts_as_whateverable
# ...
end
@philtr
philtr / postgresql.rb
Created September 8, 2012 15:28
Homebrew - PostgreSQL 9.2 RC 1 Formula
# 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/'
@philtr
philtr / grid.sass
Created September 21, 2012 13:39
easy grids with sass and bourbon
// 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}
@philtr
philtr / reverse_tunnel.bash
Created October 17, 2012 16:15
Set up a reverse tunnel for a local server
# -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
@philtr
philtr / gist:4268962
Created December 12, 2012 15:59
12/12/12 - 01/01/01
1.9.3p327 :010 > helper.distance_of_time_in_words(Date.parse("Dec 12, 2012"), Date.parse("Jan 1, 2101"))
=> "about 88 years"
@philtr
philtr / rbenv_init.zsh
Last active December 10, 2015 21:48
Speed up rbenv load time by 1,000,000x (not really, but a lot)
#
# RBEnv
#
eval "$(rbenv init --no-rehash -)"
rbenv rehash > /dev/null 2<&1 &!
@philtr
philtr / heroku-toolbelt-no-sudo.sh
Last active December 11, 2015 13:38
Install the Heroku toolbelt without sudo (for Hombrew users). Modified from https://toolbelt.heroku.com/install.sh
# Nevermind. Use Hombrew.
brew install heroku-toolbelt
@philtr
philtr / en-US.yml
Last active December 16, 2015 17:19
Inject app name from settings to be available for all translations as an interpolation.
en-US:
welcome: "Welcome to %{app_name}!"
goodbye: "See ya later, %{name}. Come back to %{app_name} soon!"