This file contains 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
... | |
[merge] | |
summary = true | |
tool = p4 | |
[mergetool "p4"] | |
cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "$PWD/$BASE" "$PWD/$LOCAL" "$PWD/$REMOTE" "$PWD/$MERGED" | |
keepBackup = false | |
trustExitCode = false | |
[mergetool] | |
keepBackup = false |
This file contains 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 GivesCreditToPreferredCustomers | |
LOOK_BACK_PERIOD = 3 | |
def self.for_large_orders(sales_amount, added_credit) | |
# the has_large_purchases scope now takes two arguments | |
preferred_customers = Customer.has_large_purchases(sales_amount, LOOK_BACK_PERIOD) | |
preferred_customers.each do |customer| | |
customer.add_credit added_credit | |
end | |
end | |
end |
This file contains 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
// From the book - Javascript: The Good Parts. | |
// Differential Inheritance | |
var myMammal = { | |
name: 'Herb the Mammal', | |
getName: function() { | |
return this.name; | |
}, | |
says: function() { | |
return this.saying || ''; |
This file contains 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 observer = { | |
addSubscriber: function(callback) { | |
this.subscribers[this.subscribers.length] = callback; | |
}, | |
removeSubscriber: function(callback) { | |
for (var i = 0; i < this.subscribers.length; i++) { | |
if (this.subscribers[i] === callback) { | |
delete (this.subscribers[i]); | |
} |
This file contains 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
Misko, | |
I submitted a fairly large pull request to jasmine-node a couple of weeks ago (https://github.com/mhevery/jasmine-node/pull/105). I wanted to fix the way the verbose version of the TerminalReporter works, since it couldn't parse out nested describe statements from jasmine results. I separated out a TerminalVerboseReporter that creates a nice, colored report in the terminal. | |
I am very excited about this project. I'd like to add further tests around other parts of the app and I am considering adding acceptance tests as well. | |
Unfortunately, I don't see any activity around jasmine-node since December 14th. | |
Would you mind if I forked the project, released it under a new npm and merge the two back together when you're able to work on it again? |
This file contains 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
should = require 'should' | |
House = { | |
leave: (dude) -> | |
'leaves the house' | |
closeTheDoor: (dude) -> | |
'closes the door' | |
} | |
Car = { | |
jumpIn: (dude) -> |
This file contains 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
#!/bin/bash | |
function create_dir { | |
if [ ! -d $1 ]; | |
then | |
mkdir $1 | |
fi | |
} | |
echo "create the src directory..." |
This file contains 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<!-- | |
Created using / | |
Source can be edited via /anakul/8/edit | |
--> | |
<head> |
This file contains 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
When /^I am on the Billing\/Shipping address page$/ do | |
# setting the order_id to 1 in the session | |
class Spree::BaseController < ApplicationController | |
prepend_before_filter :stub_order_id_in_session | |
def stub_order_id_in_session | |
session[:order_id] = 1 | |
end | |
end |
This file contains 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
module Enumerable | |
def bubble_sortit | |
reached_end = true | |
(1..self.length-1).each do |e| | |
if self[e] < self[e-1] | |
self[e-1], self[e] = self[e], self[e-1] | |
reached_end = false | |
end | |
end |