I hereby claim:
- I am jasoncodes on github.
- I am jasoncodes (https://keybase.io/jasoncodes) on keybase.
- I have a public key whose fingerprint is 00FE 9E5D 9F6E DBF2 B03E 971E CA17 A856 9172 8429
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
Build your dotfiles (shell, Vim config) from multiple sources with fresh.
Both of our dotfiles are built using fresh. We source Vim and other config from each other:
On the shared machine: | |
Download http://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.33.0.jar&can=2&q= | |
$ brew install chromedriver | |
$ java -jar selenium-server-standalone-2.33.0.jar | |
On the local machine: | |
Set `CHROME_HOSTNAME` in your `.env`, `.rbenv_vars`, or per run. |
path = '/products/42/edit' | |
params = Rails.application.routes.recognize_path path | |
route = nil; Rails.application.routes.formatter.send(:match_route, nil, params) { |r| route ||= r } | |
p route.name # returns "edit_product" |
function __database_yml { | |
if [[ -f config/database.yml ]]; then | |
ruby -ryaml -rerb -e "puts YAML::load(ERB.new(IO.read('config/database.yml')).result)['${RAILS_ENV:-development}']['$1']" | |
fi | |
} | |
function psql | |
{ | |
if [[ "$(__database_yml adapter)" == 'postgresql' ]]; then | |
PGDATABASE="$(__database_yml database)" "$(/usr/bin/which psql)" "$@" |
Enumerable.class_eval do | |
def group_by_many | |
{}.tap do |groups| | |
each do |value| | |
keys = yield value | |
keys.each do |key| | |
group = groups[key] ||= [] | |
group << value | |
end | |
end |
class CreateItemChildrenCountView < ActiveRecord::Migration | |
def self.up | |
execute <<-SQL | |
CREATE VIEW item_children_count AS | |
SELECT parent_id AS item_id, COUNT(*) as children_count | |
FROM items GROUP BY parent_id; | |
SQL | |
end | |
def self.down |
/ ... | |
- f.inputs do | |
= f.hidden_field :lock_version | |
/ ... |
# The latest version of this script is now available at | |
# https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
VERSION=1.9.3-p286 | |
brew update | |
brew install rbenv ruby-build rbenv-vars readline ctags | |
if [ -n "${ZSH_VERSION:-}" ]; then | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
else | |
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
// ==UserScript== | |
// @name Pivotal Tracker: Fight Wrinkles | |
// @description Fixes a few small UI annoyances with Pivotal Tracker. | |
// @author Jason Weathered | |
// @namespace http://jasoncodes.com/ | |
// @match https://www.pivotaltracker.com/* | |
// @include https://www.pivotaltracker.com/* | |
// @version 1.0.0 | |
// ==/UserScript== |