Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lukerandall on github.
  • I am lukerandall (https://keybase.io/lukerandall) on keybase.
  • I have a public key ASCbDp381tSsaepjtEBFAuIzTQwiwEcZnIzRtIuSpHSt-Qo

To claim this, I am signing this object:

@lukerandall
lukerandall / a.rb
Last active August 29, 2015 14:06
Distressed ducks
require 'time'
start_time = Time.now
readings, streaks, latest_streak = File.open('quacklog.txt').gets.split(', ').collect{|t| Time.parse(t)}, [], 0
readings.each_with_index do |t, i|
next if i == 0
if t - readings[i-1] <= 2.0
latest_streak += 1
else
streaks << latest_streak if latest_streak >= 3
@lukerandall
lukerandall / keybase.md
Created September 24, 2014 12:29
keybase.md

Keybase proof

I hereby claim:

  • I am lukerandall on github.
  • I am lukerandall (https://keybase.io/lukerandall) on keybase.
  • I have a public key whose fingerprint is 5276 C4BF 7D84 19B8 81A5 58EB 5663 DCF9 486C 62A4

To claim this, I am signing this object:

alias gap='git add -p'
alias gb='git branch'
alias gc='git commit -v'
alias gca='git commit -a -v'
alias gco="git checkout"
alias gd='git diff'
alias gdc='git diff --cached'
alias gdh='git diff HEAD'
alias gl='git pull'
alias glod='git log --oneline --decorate'
class Doorman
attr_reader :user, :portal, :account
def initialize(user, portal, account)
@user = user
@portal = portal
@account = account
end
# Returns a collection of accounts scoped to the user's rights of access.
class Doorman
attr_reader :user, :portal, :account
def initialize(user, portal, account)
@user = user
@portal = portal
@account = account
end
def accessible_accounts
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
(load-theme 'twilight-anti-bright)
set hidden " allow buffers to be hidden when they have unsaved changes
set visualbell " turn off beeps
set nobackup " don't need backups with git
call pathogen#runtime_append_all_bundles()
let mapleader = "," " map leader key
imap jj <Esc>
" Remap C-(e|y) so that they scroll by 3 lines
namespace :bundler do
desc "Updates gems using bundler"
task :update_gems do
run "cd #{release_path} && bundle install vendor --disable-shared-gems --relock --without test"
end
end
namespace :db do
desc "Symlink database.yml config file"
task :symlink_config do
DVORAK = {
:a => 0,
:b => 4,
:c => 2,
:d => 1,
:e => 0,
:f => 2,
:g => 2,
:h => 0,
:i => 1,