Skip to content

Instantly share code, notes, and snippets.

@mattsnyder
mattsnyder / warrior_6.rb
Created Mar 6, 2014
Ruby Warrior Level 6
View warrior_6.rb
class Strategy
def initialize(warrior, player)
@warrior = warrior
@player = player
end
def remember(memo)
player.remember memo
end
@mattsnyder
mattsnyder / level6.rb
Created Mar 6, 2014
Ruby Warrior Solutions Levels 6-9
View level6.rb
class Strategy
def initialize(warrior, player)
@warrior = warrior
@player = player
end
def remember(memo)
player.remember memo
end
@mattsnyder
mattsnyder / warrior_8.rb
Created Mar 6, 2014
Ruby Warrior Level 8 (kills captive)(works on 9 too)
View warrior_8.rb
class Strategy
def initialize(warrior, player)
@warrior = warrior
@player = player
end
def run
false
end
@mattsnyder
mattsnyder / warrior_7.rb
Created Mar 6, 2014
Ruby WarriorLevel 7
View warrior_7.rb
class Strategy
def initialize(warrior, player)
@warrior = warrior
@player = player
end
def run
false
end
View fst.haml
:ruby
@site = UT::SiteSucker.new(params[:url])
= content_for :bottom_js do
:plain
window.launchTest = function(e){
$('#utfst_start').remove()
$('#sucked_site').show()
};
@mattsnyder
mattsnyder / GsRYp6No.sql
Last active Aug 29, 2015
remove linked studies from dropdown (Trello GsRYp6No)
View GsRYp6No.sql
begin;
SELECT
id,
linked_study_id,
folder_id
FROM studies
WHERE
linked_study_id IS NOT NULL AND
folder_id IS NOT NULL;
View TShape.md
  • Would I want this person to be my boss?
  • Would I learn a significant amount from him or her?
  • What if this person went to work for our competition?
  • What kind of T shape are they?
    • Highly skilled at a broad set of valuable things (top of T)?
    • Among the best in their field within a narrow discipline (leg of the T)?
View mocha.rb
# For mocha integration, add this file into features/support folder
require "mocha"
World(Mocha::Standalone)
Before do
mocha_setup
end
View gist:448416
#!/bin/bash
echo "Setting up chef..."
sudo apt-get -y update
sudo apt-get -y install ruby ruby1.8-dev libopenssl-ruby1.8 rdoc ri irb build-essential wget ssl-cert
cd /tmp
wget http://rubyforge.org/frs/download.php/57643/rubygems-1.3.4.tgz
tar zxf rubygems-1.3.4.tgz