Skip to content

Instantly share code, notes, and snippets.

Operable Software

What does it mean to make software that doesn't just run, but is operable?

Good question! This represents some current thinking on the topic; there's tons of details in each of these things, so this list is expected to change and get more detailed over time.

Operable Software seems to involve (at a minimum) thinking a lot harder about and making sure there is a strategy (and code where appropriate) for:

  • Metrics
  • Logging
# NOTE: To test asset pipeline in development set the following config.assets.* below in
# your config/environments/development.rb and then run:
#
# $ RAILS_ENV=development rake assets:precompile
#
# It is recommended you rm -rf public/assets and turn off these settings in development when
# you are finished or this may cause issues with assets in your local development environment
#
# config.assets.compress = true
# config.assets.compile = false
@duff
duff / .bashrc
Created January 26, 2009 18:53 — forked from henrik/.bashrc
Git branch and dirty state (using git-completion.bash) and colored
# [ ~/develop/dir ] master $ # clean working directory
# [ ~/develop/dir ] master* $ # dirty working directory
# [ ~/some_dir ] $ # not a git repo
source ~/bin/.git-completion.sh # Copied the contrib/completion/git-completion.bash file in the git distribution
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
PS1='\e[0m[ \e[32m\w\e[0m ]$(__git_ps1 " \e[33m%s\e[31m$(parse_git_dirty)\e[0m") $ '
@duff
duff / bash_prompt_with_git_branch.bash
Created April 8, 2009 19:08
Some git auto complete goodness
source ~/bin/.git-completion.sh # Copied from the contrib/completion/git-completion.bash file in the git distribution (Also here: http://gist.github.com/91932)
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo '*'
}
PS1='\[\e[0m\][ \[\e[32m\]\w \[\e[0m\]]$(__git_ps1 " \[\e[33m\]%s$(parse_git_dirty)") \[\e[0m\]$ \[\e[0m\]'
alias bash_profile='vi ~/.bash_profile && source ~/.bash_profile'
@duff
duff / gist:132557
Created June 19, 2009 10:55 — forked from defunkt/gist:132456
Bash snippet to open new shells in recent directory
# Bash snippet to open new shells in most recently visited dir.
# Useful if you want to open a new terminal tab at the present
# tab's location.
#
# Put this in your .bashrc or whatever.
pathed_cd () {
if [ "$1" == "" ]; then
cd
else
@duff
duff / post-merge
Created June 26, 2009 15:34 — forked from austintaylor/post-merge
Show the diff after a git merge
#!/bin/sh
# Print out what changed in a nice format.
git log @{1}.. --pretty=format:"%Cblue%an%Creset %ar: %Cred\"%s%b\"%Creset (%h)" --reverse
@duff
duff / gist:319907
Created March 2, 2010 20:35
Easily jump to Rails migrations
Learned about this feature in the rails.vim plugin:
:R/:A jump to next/previous timestamped migration.
@duff
duff / gist:320619
Created March 3, 2010 13:59
Moving the cursor in visual mode
In visual mode, press o to move the cursor to the other end of the selected region.
This allows you to easily adjust the selected region from either side.
Pressing O while in visual block mode moves the cursor to the other corner.
@duff
duff / gist:320890
Created March 3, 2010 19:13
Webrat monkey patch so save_and_open_page can use stylesheets
module Webrat
module SaveAndOpenPage
def save_and_open_page
return unless File.exist?(Webrat.configuration.saved_pages_dir)
filename = "#{Webrat.configuration.saved_pages_dir}/webrat-#{Time.now.to_i}.html"
File.open(filename, "w") do |f|
f.write prettified(response_body)
end
@duff
duff / gist:325216
Created March 8, 2010 14:51
Bash alias for simple git log output
alias gl='git log -n1000 --no-merges --pretty=format:"* %s (%cn) %b"'