Skip to content

Instantly share code, notes, and snippets.

@sambao21
sambao21 / kcruby_irc.md
Last active August 29, 2015 13:58
IRC for KC Ruby
@sambao21
sambao21 / gist:6558701
Created September 14, 2013 03:56
manually install brew and cask
Sams-MacBook-Pro in /usr/local
○ → ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press ENTER to continue or any other key to abort
==> Downloading and Installing Homebrew...
remote: Finding bitmap roots...
@sambao21
sambao21 / gist:6558551
Created September 14, 2013 03:18
brew cask Permission denied error
Sams-MacBook-Pro:sambao21-sprout-wrap sambao21$ brew cask install spotify
==> Downloading http://download.spotify.com/Spotify.dmg
######################################################################## 100.0%
Error: Permission denied - /opt/homebrew-cask/Caskroom/spotify
Sams-MacBook-Pro:sambao21-sprout-wrap sambao21$ ls -la /opt/homebrew-cask
total 0
drwxr-xr-x 3 root staff 102 Sep 13 21:57 .
drwxr-xr-x 3 root wheel 102 Sep 13 21:57 ..
drwxr-xr-x 2 root staff 68 Sep 13 21:57 Caskroom
@sambao21
sambao21 / ruby_warrior_level8.rb
Last active December 20, 2015 14:39
Ruby Warrior level 8 & 9 script. Doesn't work prior to level 8 because uses look and shoot!.
class Player
def initialize
@direction = :forward
@keep_retreating = false
@health = 20
end
def play_turn(warrior)
@warrior = warrior
@sambao21
sambao21 / ruby_warrior_level_7.rb
Created August 3, 2013 21:46
This will complete Ruby Warrior levels 3-7. Won't run on level 1 and 2 because those didn't introduce certain methods yet. Didn't think to save those 2.
class Player
def initialize
@direction = :forward
@keep_retreating = false
end
def play_turn(warrior)
@warrior = warrior
if @warrior.feel(@direction).wall?
@sambao21
sambao21 / kcruby.org_site_content
Last active December 19, 2015 16:08
KC Ruby site contents draft
Currently:
* /podcasts
* /members
* tweets (but it's use the deprecated twitter api that freezes page load on chrome)
* /discussions - just a link to meetup discussions
* /events - just a link to meetup
Ideas in ongoing discussion:
* Next meetup (+ details)
* Any type of special event (eg, the RTanque competition)
@sambao21
sambao21 / sessions.md
Created May 8, 2013 17:42
Aaron and Sam's RailsConf 2013 session attended mashup

Monday

  • DHH keynote
  • How Shopify scales Rails
  • Building Extractable Libraries in Rails
  • Constellation of Architecture
  • Maintainable Templates
  • Monitoring Health of Your App
  • Object oriented in service oriented world
  • Live Streaming Rails
@sambao21
sambao21 / sambao21.zsh-theme
Created March 5, 2013 03:34
My oh-my-zshell theme
local rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}'
local user='%{$fg[cyan]%}%n%{$reset_color%}@%{$fg[magenta]%}%m%{$reset_color%}'
local pwd='%{$fg_bold[green]%}%p%{$fg[blue]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}%{$reset_color%}'
local time="%{$fg[white]%}%{$fg[yellow]%}%T%{$fg[white]%}%{$reset_color%}"
local ruby="%{$fg[white]%}[%{$fg[magenta]%}\$(rvm-prompt i v g)%{$fg[white]%}]%{$reset_color%}"
@sambao21
sambao21 / gist:5076144
Created March 3, 2013 13:46
work mbp sublime text settings
{
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/Railscasts.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".tags*",
@sambao21
sambao21 / gist:4247542
Created December 9, 2012 23:46
rooting nexus 4 on OSX
  1. Make sure device USB debugging mode turned on (Google around for the latest instructions)
  2. Install Android SDK - http://developer.android.com/sdk/index.html#download (Follow direction kinda outlined here - http://forum.xda-developers.com/showthread.php?t=1917237 adjust as necessary because these instructions probably will be outdated.)
  3. Create ~/android
  4. Unzip the sdk into ~/android
  5. Make sure tools and platform-tools directory are there, if not install, by running ~/android/adt-bundle-mac/sdk/tools/android.
  6. Make sure adb and fastboot are installed in ~/android/adt-bundle-mac/sdk/platform-tools/
  7. Export $PATH to include ~/android/adt-bundle-mac/sdk/platform-tools so we can access adb and platform-tools from anywhere
  8. Download CWM Touch and place it in ~/android - http://clockworkmod.com/rommanager