Skip to content

Instantly share code, notes, and snippets.

View phlco's full-sized avatar

Phillip Lamplugh phlco

  • Los Angeles, CA
View GitHub Profile
@phlco
phlco / sublime_text_notes.md
Last active December 18, 2015 14:08
sublime text notes
@phlco
phlco / .bash_profile
Last active December 18, 2015 15:18
updated bash profile
# https://github.com/tomislav/osx-terminal.app-colors-solarized
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Prefer US English and use UTF-8
export LC_ALL="en_US.UTF-8"
export LANG="en_US"
# Tab improvements
@phlco
phlco / Preferences.sublime-settings
Last active December 18, 2015 15:18
sublime user preferences
// install package control
// http://wbond.net/sublime_packages/package_control/installation
{
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
// https://github.com/buymeasoda/soda-theme/
// "theme": "Soda Light.sublime-theme",
"highlight_line": true,
"highlight_modified_tabs": true,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
@phlco
phlco / .gitignore_global
Created June 18, 2013 12:09
git ignore global
# Folder view configuration files
.DS_Store
Desktop.ini
# Thumbnail cache files
._*
Thumbs.db
# Files that might appear on external disks
.Spotlight-V100
@phlco
phlco / postgres_cheatsheet.md
Last active December 18, 2015 21:59
cheat sheet for postgres commands

Postgres Cheatsheet

connect to postgres

$ psql

list databases

@phlco
phlco / hashes
Created June 24, 2013 16:21
hashes
$ pry
[1] pry(main)> room = {}
=> {}
[2] pry(main)> room[:kitchen] = "to the left"
=> "to the left"
[3] pry(main)> room[:bedroom] = "to the right"
=> "to the right"
[4] pry(main)> room.keys
=> [:kitchen, :bedroom]
[5] pry(main)> room.values
@phlco
phlco / postgres
Created June 27, 2013 18:31
postgres
PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
@phlco
phlco / sinatra pg db helper
Created July 1, 2013 14:32
sinatra pg db helper
helpers do
def db_exec(sql)
conn = PG.connect(:dbname =>'DB_NAME', :host => 'localhost')
result = conn.exec(sql)
conn.close
result
end
end
DROP TABLE people;
DROP TABLE houses;
CREATE TABLE houses
(
id SERIAL PRIMARY KEY,
name VARCHAR(255),
sigil VARCHAR(255),
motto VARCHAR(255)
);
@phlco
phlco / dev_gems.rb
Last active December 19, 2015 11:09
annotated gems for development
group :development, :test do
gem 'pry-rails' # Causes rails console to open pry
# https://github.com/rweng/pry-rails
gem 'pry-debugger' # Adds step, next, finish, and continue commands and breakpoints
# https://github.com/nixme/pry-debugger
gem 'pry-stack_explorer' # Navigate the call-stack
# https://github.com/pry/pry-stack_explorer
gem 'annotate' # Annotate all your models, tests, fixtures, and factories
# https://github.com/ctran/annotate_models
gem 'quiet_assets' # Turns off the Rails asset pipeline log