Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@conanite
conanite / application.js
Created October 16, 2012 08:13
Prevent users double-clicking links and form submit buttons and anything else
$("input[type='submit']").one_click_only();
@conanite
conanite / date.rb
Created January 30, 2012 21:36
ActiveRecord, I18n, Date, and UX
class Date
class << self
alias :_ruby_parse :_parse
def _parse(str, comp=true)
if I18n.locale.to_sym == :en
_ruby_parse str, comp
else
map = month_map I18n.locale
str = str.gsub /[^\s\/\d-]+/ do |month|
#!/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.
split(/\n/).
map { |f| f.gsub "#{base}", '' }.