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:
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== |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Blue Component</key> | |
<real>0.0</real> | |
<key>Green Component</key> | |
<real>0.0</real> |