This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simple, DRY autoloading | |
require 'active_support' | |
class Module | |
def const_missing_with_mojo mod | |
# HACK ALERT eject if activesupport voodoo is interfering | |
targ = caller.reject {|x| x =~ /active_?support/ }[0].split(':').first | |
autoload_path targ | |
if const_defined? mod | |
const_get mod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Spec | |
module Example | |
module ExampleGroupMethods | |
def slow_specs &bl | |
bl.call() if run_slow_specs? | |
end | |
def run_slow_specs? | |
ENV['SLOW_SPECS'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; | |
;; color-theme-sore-eyes.el | |
;; | |
;; Made by David Lee | |
;; Login <[email protected]> | |
;; | |
;; Started on Mon Jul 21 12:05:27 2008 David Lee | |
;; Last update Mon Jul 21 12:05:27 2008 David Lee | |
;; | |
(eval-when-compile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; | |
;; color-theme-dml.el | |
;; | |
;; Made by David Lee | |
;; Login <[email protected]> | |
;; | |
;; Started on Mon Jul 21 12:05:27 2008 David Lee | |
;; Last update Mon Jul 21 12:05:27 2008 David Lee | |
;; | |
(eval-when-compile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add "+universal" to /opt/local/etc/macports/variants.conf | |
Uncomment in /opt/local/etc/macports.conf: | |
variants_conf /opt/local/etc/macports/variants.conf | |
sudo port -v install git-core +bash_completion +doc | |
sudo port -v install ImageMagick \ | |
Xft2 \ | |
antiword \ | |
atk \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# set up FQDN | |
echo "you better have a hostname, or shit won't work!" | |
echo "and, we expect /etc/chef/validation.pem to exist and match the server" | |
sleep 1 | |
# install packages | |
apt-get install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert git-core |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How to determine whether to buy a tool for your employee | |
v = xp + cr | |
x = total cost of employee (usually approx. double their salary) over | |
useful lifetime of tool | |
p = productivity gain provided by tool, expressed as a fraction of x | |
c = increase in employee retention provided by tool, expressed as a | |
fraction of 1 | |
r = total cost of hiring and training a replacement to current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MultiLogger | |
def also_log_to file, &block | |
@_original_logger, self.logger = logger, ActiveSupport::BufferedLogger.new(file) | |
yield | |
self.logger, @_original_logger = logger, nil | |
end | |
end | |
# in application.rb: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gem completions | |
# this is a guess. salt to taste. | |
export GEM_SEARCH_PATH=`ruby -e 'require "rubygems"; puts Gem.path.first'`/gems | |
# completion fuction for compdef: just lists the gems folders | |
_gems() { compadd `cd $GEM_SEARCH_PATH; echo *` } | |
compdef _gems gemcd ; gemcd() { cd $GEM_SEARCH_PATH/$1 } | |
compdef _gems gemedit ; gemedit() { mate $GEM_SEARCH_PATH/$1 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deploy@dvsyd2nxpdev01:/usr/share/emacs/22.2/lisp$ apt-file search zone.elc | |
emacs-snapshot-common: /usr/share/emacs/23.0.60/lisp/play/zone.elc | |
emacs-snapshot-common: /usr/share/emacs/23.0.60/lisp/timezone.elc | |
emacs21-common: /usr/share/emacs/21.4/lisp/play/zone.elc | |
emacs21-common: /usr/share/emacs/21.4/lisp/timezone.elc | |
emacs22-common: /usr/share/emacs/22.2/lisp/play/zone.elc | |
emacs22-common: /usr/share/emacs/22.2/lisp/timezone.elc | |
xemacs21-basesupport: /usr/share/xemacs21/xemacs-packages/lisp/xemacs-base/timezone.elc |