Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / kcruby_irc.md
Last active August 29, 2015 13:58
IRC for KC Ruby