Skip to content

Instantly share code, notes, and snippets.

View falonofthetower's full-sized avatar

Peter Karth falonofthetower

  • CompanyCam
  • Sanford, NC
View GitHub Profile
First off this game is huge. I'm impressed. Most of your code looks to be pretty solid, and your tests are clearly advanced for this stage (we cover testing more extensively later on in the course).
I'm going to concentrate on the area that I see the biggest opportunity for improvement. That is going to be in your modules. First thing I noticed was that you are using `@@global` variables. These are generally frowned on because they can have unexpected side effects. More than that though your structure ends up repeating itself a lot. Many of the methods end up with just one line of difference:
```ruby
break if new_location[0] < Neighborhood.top_left_limit[0]
break if new_location[0] > Neighborhood.bottom_right_limit[0]
```
@ef2k
ef2k / usr_bin_subl.sh
Last active August 10, 2016 20:16
Detach sublime from terminal (/usr/bin/subl)
#!/bin/bash
# Detach sublime from terminal
nohup /opt/sublime_text_2/sublime_text --class=sublime-text-2 "$@" 2>/dev/null &
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')