Skip to content

Instantly share code, notes, and snippets.

@brymck
brymck / battery_charge.zsh
Created July 10, 2012 13:52
zsh battery display for OS X
# A purely .zsh method inspired by Steve Losh's Python script for displaying battery power with zsh:
# http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/#my-right-prompt-battery-capacity
#
# For best results assign to RPROMPT
function battery_charge {
# Adjust to your preferred number of segments
typeset -i SEGMENTS
SEGMENTS=10
# Get maximum and current capacity as floats via ioreg
@brymck
brymck / konjac_env.sh
Created March 13, 2012 04:32
Getting Xcode to compile the latest Ruby
#!/bin/sh
#
# First install the latest Command Line Tools for Xcode package:
# https://developer.apple.com/downloads/index.action?name=command%20line%20tools%20for%20xcode
#
# You can then run this by either copying and pasting everything into a terminal or running:
# bash -s < <(curl -L https://raw.github.com/gist/2026768/konjac_env.sh)
#
# Install Homebrew
@brymck
brymck / gist:1843229
Created February 16, 2012 08:17
Installing RVM, Ruby and .vim
# Install RVM
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
# Tell bash (the terminal) to automatically load RVM, then tell bash to reload
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
source ~/.bash_profile
# Install the latest version of Ruby and set it as the default
rvm install 1.9.3
rvm use 1.9.3 --default
@brymck
brymck / gist:1816919
Created February 13, 2012 13:12
System configuration
#!/usr/bin/env ruby
=begin
To run, copy and paste the following command into a console:
ruby < <(curl -s https://raw.github.com/gist/1816919/469a4086833ce3b3496476aef1246c5d81b7ac99/gistfile1.rb)
And shucks, if that doesn't work, there's always this:
bash --version && \
brew --version && \
bundle --version && \
curl --version && \