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
Given "a user" do | |
@user = User.new | |
end | |
When "I activate that user" do | |
@user.avtivate! | |
end | |
# 10 other steps that all depend on/change "@user" |
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
Statefulton(:user) do | |
builder { User.new } | |
make "a" | |
expects "that" # Calling "that" will return the singular instance | |
end | |
# Given a user | |
# When I activate that user |
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
if Rails.env.development? | |
Rails.application.assets.logger = Logger.new('/dev/null') | |
Rails::Rack::Logger.class_eval do | |
def before_dispatch_with_quiet_assets(env) | |
before_dispatch_without_quiet_assets(env) unless env['PATH_INFO'].index("/assets/") == 0 | |
end | |
alias_method_chain :before_dispatch, :quiet_assets | |
end | |
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
require 'guard/rspec' | |
extensions = ["Guard::RSpec", "Guard::Schema", "Guard::Routes"] | |
module ::Guard | |
class Schema < ::Guard::Guard | |
def run_on_change(_) | |
UI.info "Clearing the way" | |
`rake db:test:prepare` | |
UI.clear | |
UI.info "Ready to lead the charge!" |
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
def cross_site_sharing | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Request-Method'] = 'POST, OPTIONS' | |
headers['Access-Control-Allow-Headers'] = 'X-Requested-With' | |
headers['Access-Control-Max-Age'] = '1278000' | |
headers['Content-Length'] = '0' | |
headers['Content-Type'] = 'text/plain' | |
render nothing: true, status: 200 | |
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
# 1 | |
(0..1000).reject {|x| not (x%3 == 0 or x%5 == 0) }.inject(:+) |
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
Student Computer Science Organizations have new days, times | |
The NMU Association for Computing Machinery (ACM), which previously met Fridays at 5pm will now be meeting Thursdays at 5pm in order to make meetings more convenient for students to attend. If you are unfamiliar with this organization, ACM is a campus organization that explores a wide range of Computer Science related topics, and focuses on student run presentations and discussions. Previous topics have included overviews of the Ruby and Python programming languages, test driven development, iPhone programming, and game development. For more information, contact the ACM President Dave Lyon ([email protected]). | |
This weeks ACM meeting: Wireshark and Network Discovery (Darren StAmour), Mike Campfield discusses his internship (3D/Game Design) | |
// Todo: UUG Bits Here |
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
require 'rubygems' | |
require 'plist' | |
r = Plist::parse_xml("/Users/dave/Desktop/ItunesLibrary.xml") | |
lib = Hash.new() | |
r["Tracks"].each do |track| | |
album = track[1]["Album"] |
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
cp $2 "$1/$2" | |
cd $1 | |
# Run with . ./test.sh $DIR_TO_CP_TO $FILE |
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
var fortunes=new Array(" One learns to itch where one can scratch. -- Ernest Bramah "," One meets his destiny often on the road he takes to avoid it. "," One monk said to the other, \"The fish has flopped out of the net! How will it live?\" The other said, \"When you have gotten out of the net, I'll tell you.\" "," Only that in you which is me can hear what I'm saying. -- Baba Ram Dass "," Only those who leisurely approach that which the masses are busy about can be busy about that which the masses take leisurely. -- Lao Tsu "," Paradise is exactly like where you are right now ... only much, much better. -- Laurie Anderson "," Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away. -- Antoine de Saint-Exupery "," Perhaps the biggest disappointments were the ones you expected anyway. "," Philosophy will clip an angel's wings. -- John Keats "," Push where it gives and scratch where it itches. "," Reality always seems harsher in the early morning. ", |