Skip to content

Instantly share code, notes, and snippets.

View getpw
#!/usr/bin/env ruby
# -*- ruby-mode -*-
base = File.expand_path "~/.password-store"
pass_files = `find #{base} | grep -v -e .git -e .gpg-id`
trimmed = pass_files.
map { |f| f.gsub "#{base}", '' }.
conanite / application.js
Created October 16, 2012 08:13
Prevent users double-clicking links and form submit buttons and anything else
View application.js
conanite / date.rb
Created January 30, 2012 21:36
ActiveRecord, I18n, Date, and UX
View date.rb
class Date
class << self
alias :_ruby_parse :_parse
def _parse(str, comp=true)
if I18n.locale.to_sym == :en
_ruby_parse str, comp
map = month_map I18n.locale
str = str.gsub /[^\s\/\d-]+/ do |month|