This file contains hidden or 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
iOS 4.2.1 detects shows the announced DNS settings in Settings, Wi-Fi Networks within a second of starting `radvd`. The search domain does not appear to be supported. |
This file contains hidden or 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
#!/usr/bin/env ruby -w | |
require 'shellwords' | |
require 'fileutils' | |
# generate plain text versions | |
Dir['*.html'].each do |html_filename| | |
open("|elinks -dump -dump-width 9000 -no-numbering -no-references #{Shellwords.escape(html_filename)}") do |io| |
This file contains hidden or 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
<?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> |
This file contains hidden or 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
// ==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== |
This file contains hidden or 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
# 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 |
This file contains hidden or 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
/ ... | |
- f.inputs do | |
= f.hidden_field :lock_version | |
/ ... |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
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)" "$@" |
This file contains hidden or 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
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" |