Skip to content

Instantly share code, notes, and snippets.

@bds
bds / find_xargs_grep_sed.sh
Created June 3, 2014 03:45
find, xargs, grep and sed
find . -name *spec.rb |xargs grep -l 86400| xargs sed -i '' 's/86400/10/g'
@bds
bds / osx-i-love-you.rb
Last active August 29, 2015 14:02
say I love you
`say -v? | cut -f1 -d' '`.split("\n").each {|v| `say -v "#{v}" I love you`}
@bds
bds / exception-one-liner.rb
Created September 17, 2014 17:16
Ruby Exception Oneliner
(rdb:1) begin model.association.find_by(label: field["name"]); rescue => e; puts e.class; end
@bds
bds / keybase.md
Created September 18, 2014 00:41

Keybase proof

I hereby claim:

  • I am bds on github.
  • I am bds (https://keybase.io/bds) on keybase.
  • I have a public key whose fingerprint is F157 0BAD 213C 68E5 5989 5EB0 F101 7FA2 66D5 7F86

To claim this, I am signing this object:

@bds
bds / gist:7dff642d43bbe481457b
Created October 1, 2014 20:52
Mongoid Finder Methods
mongoid-3.1.6/lib/mongoid/criterion/modifiable.rb
@bds
bds / gist:ee7d42e82a86d601489d
Created October 23, 2014 05:47
Disable Pry
DISABLE_PRY_RAILS=1 rails console
@bds
bds / .vimrc
Created August 6, 2015 22:08
Minimal .vimrc
set nocompatible " We are using Vim
syntax on
set colorcolumn=80
set ruler
hi StatusLine ctermfg=0 ctermbg=3 cterm=bold " Window highlighting
hi StatusLineNC ctermfg=white ctermbg=4 cterm=none
hi Folded ctermfg=244 ctermbg=0 cterm=none " Code folding highlight
@bds
bds / .bashrc
Last active January 14, 2021 19:12
dotfiles
# Cult of Vi
set -o vi
export VISUAL=vim
export EDITOR="$VISUAL"
# Colors!
alias ls='ls -G'
# History
export HISTFILE=~/.bash_history
@bds
bds / .vimrc
Created November 14, 2015 20:54
.vimrc
set nocompatible " We are using Vim
syntax on
" * PLUGINS
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
@bds
bds / tmux-colors.sh
Last active March 11, 2016 22:01
Print Tmux colors
#!/usr/bin/env bash
for i in {0..255} ; do
printf "\x1b[38;5;${i}mcolour${i}\n"
done