Skip to content

Instantly share code, notes, and snippets.

View jonstokes's full-sized avatar

Jon Stokes jonstokes

View GitHub Profile

Setup new Mac with OSX Mountain Lion from scratch

These commands are good as of 2013-1-8.

Install The latest XCode from the App Store

App store http://itunes.apple.com/us/app/xcode/id448457090?mt=12) The download/install takes awhile so start it first. When it finishes downloading you will still need to run it to complete installation.

Install Command Line Tools

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@jonstokes
jonstokes / git-happy.zsh-theme
Last active December 18, 2015 11:59
My "Git Happy!" ZSH theme (based on robby-russell). I use this with Solarized, and it is awesome.
PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(check_git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
RPROMPT='%{$fg_bold[green]%}$(git_prompt_short_sha)%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="(%{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
#ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[red]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%})"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@jonstokes
jonstokes / poltergeist.rb
Created July 13, 2014 23:33
Monkey patching poltergeist for use with JRuby 1.7.11
require "capybara"
require "capybara/poltergeist"
require "capybara/poltergeist/utility"
module Capybara::Poltergeist
Client.class_eval do
def start
@pid = Process.spawn(*command.map(&:to_s), pgroup: true)
ObjectSpace.define_finalizer(self, self.class.process_killer(@pid))
end

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@jonstokes
jonstokes / gist:809a1bd9628b7913cb41
Created September 29, 2015 21:31
Keybase identity
### Keybase proof
I hereby claim:
* I am jonstokes on github.
* I am jonstokes (https://keybase.io/jonstokes) on keybase.
* I have a public key whose fingerprint is FA64 D2B7 B076 B3DF 592A 6295 C17A 9056 03A2 F315
To claim this, I am signing this object:
@jonstokes
jonstokes / gist:b759445b2f6709a28fa2
Created September 29, 2015 21:59
Onename verification
Verifying that +jonstokes is my blockchain ID. https://onename.com/jonstokes
Bloggy McBlogface is my master.
```
def foo(bar)
baz
end
```
@jonstokes
jonstokes / gist:f61d3ec2a9ec4b3736320b8dace6c235
Created July 9, 2017 00:56 — forked from kalmbach/gist:4471560
Rake task sugar for Sequel Migrations (version, migrate, rollback, reset)
namespace :db do
require "sequel"
Sequel.extension :migration
DB = Sequel.connect(ENV['DATABASE_URL'])
desc "Prints current schema version"
task :version do
version = if DB.tables.include?(:schema_info)
DB[:schema_info].first[:version]
end || 0
@jonstokes
jonstokes / print.js
Created January 6, 2022 06:07 — forked from gfodor/print.js
print all users to console
javascript:console.log(Object.values(window.APP.hubChannel.presence.state).map(v => v.metas[0].profile.displayName).join(","));