This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Strategy | |
| def initialize(warrior, player) | |
| @warrior = warrior | |
| @player = player | |
| end | |
| def run | |
| false | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Strategy | |
| def initialize(warrior, player) | |
| @warrior = warrior | |
| @player = player | |
| end | |
| def run | |
| false | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Strategy | |
| def initialize(warrior, player) | |
| @warrior = warrior | |
| @player = player | |
| end | |
| def remember(memo) | |
| player.remember memo | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Symlink the completion and prompt scripts from your Git install to your home directory | |
| # Then add the following to your .bash_profile | |
| source ~/git-completion.bash | |
| source ~/git-prompt.sh | |
| export GIT_PS1_SHOWDIRTYSTATE=1 | |
| export GIT_PS1_SHOWUNTRACKEDFILES=1 | |
| export PS1='\033[00;36m\]\W\[\033[01;37m\]$(__git_ps1)\[\033[01;36m\] \$\[\033[00m\] ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class NullObject | |
| def initialize | |
| @origin = caller.first ### SETS ORIGIN FOR INSPECT INFO | |
| end | |
| def method_missing(*args, &block) | |
| self | |
| end | |
| def nil?; true; end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| title: "My app server" | |
| logfile: /var/log/fuey.log | |
| notifications: | |
| - | |
| - "run.trace" | |
| - "Fuey::Log" | |
| traces: | |
| VPN_UP: | |
| - Ping: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PersonsController | |
| extend ::Sentry | |
| def show | |
| # do stuff | |
| end | |
| sentry_for :show, :expect => [:person], :if_not => :handle_person_not_found | |
| def subscribe | |
| # do stuff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| include ActionView::Helpers # If you want to test from a Rails console | |
| number_to_currency(12.34, :locale => :en) # => "$12.34" | |
| number_to_currency(12.34, :locale => :ja) # => "12円" | |
| number_to_currency(12.34, :locale => 'en-GB') # => "£12.34" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set -g default-terminal "xterm-256color" # More colors | |
| set-option -g xterm-keys on # Work more nicely with odd key combos (emacs) | |
| set -g base-index 1 # Tabs start at '1', not '0' | |
| set -s escape-time 0 # Faster activation | |
| # Bind <C-q> to leader | |
| # Make sure to update status-right to include your leader! | |
| unbind C-b | |
| set -g prefix C-q | |
| bind-key q send-prefix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Include this method in your application_controller.rb | |
| def self.expose(*variable_names) | |
| variable_names.each do |variable_name| | |
| define_method((variable_name.to_s+"=").to_sym) do |value| | |
| @exposed ||= Hash.new | |
| @exposed[variable_name]= value | |
| end | |
| private (variable_name.to_s+"=").to_sym | |
| define_method(variable_name) do |