Skip to content

Instantly share code, notes, and snippets.

Avatar

Stephen Celis stephencelis

View GitHub Profile
View cached_account.rb
class CachedAccount < CachedDelegateClass(Recurly::Account)
self.cache_key = :account_code
cache_constructor :find
cache(:billing_info)
cache(:subscription) { subscriptions.live.first }
cache(:add_ons) { subscription.try(:add_ons).to_a }
cache(:plan) { subscription.try :plan }
cache(:balance) {
View zelda-battery-tmux.sh
#!/usr/bin/env sh
#
# Works best with blinking text: the last heart will blink when you have less
# than 25% of your battery life remaining.
#
# Add the following to your `~/.tmux.conf`;
#
# set -g status-right "#[fg=red]#(path/to/zelda-battery-tmux.sh) "
battery="$(pmset -g ps | awk 'NR==2' | perl -pe 's/.*?(\d+)%.*/\1/')"
@stephencelis
stephencelis / gist:286436
Created Jan 26, 2010 — forked from qrush/gist:286431
_why's ~/.screenrc
View gist:286436
# .( screenrc ). for _why :: * supports xterm/rxvt titles
# * default encoding is utf-8 (i use urxvt with this)
setenv LC_CTYPE en_US.UTF-8
defutf8 on
autodetach on
crlf off
#deflogin off
hardcopy_append on
View build-emacs-osx.rb
#!/bin/env ruby
require 'fileutils'
# Most Macs these days are dual-core machines. This should, maybe, default to 2.
print "How many cores does your system have? [1] "
cores = gets.chomp.to_i
cores = 1 if cores < 1
config_opts = ["--with-jpeg=no", "--with-gif=no", "--with-tiff=no", "--with-ns"]