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
# Following instructions found on http://stackoverflow.com/questions/359424/detach-subdirectory-into-separate-git-repository/359759#359759 | |
# Clone your project repo (making sure to copy all files, even hard links) | |
git clone --no-hard-links my_app my_active_shipping | |
cd my_active_shipping | |
# In your new repo, extract only the commits related to the vendor'd plugin and move that into the new root | |
git filter-branch --subdirectory-filter vendor/plugins/active_shipping/ HEAD | |
git reset --hard | |
# Clean out all of the other commits | |
git gc --aggressive | |
git prune |
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
framework 'Cocoa' | |
framework 'WebKit' | |
require 'optparse' | |
class Browser | |
attr_accessor :view | |
def initialize | |
@view = WebView.alloc.initWithFrame([0, 0, 520, 520]) |
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
framework 'Cocoa' | |
framework 'WebKit' | |
class Cat | |
attr_accessor :name, :age | |
def initialize(name = 'kitty', age=42) | |
@name = name | |
@age = age | |
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
require 'open-uri' | |
require 'rubygems' | |
require 'hpricot' | |
LAST_NAMES = %w{ | |
black | |
white | |
gray | |
green | |
red |
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
group :development, :test do | |
gem 'awesome_print', :require => "ap" # Console pretty printing | |
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
# Can be placed in with your test helpers. Eventually I'm hoping to package as a gem | |
module Wrong | |
class ActiveRecordErrors < FailureMessage::Formatter | |
register | |
def match? | |
predicate.is_a?(Predicated::Call) && | |
object_is_an_active_record?(predicate.left) && | |
method_runs_validations?(predicate.method_sym) && | |
failed_because_of_validations?(predicate.left) |
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
<html> | |
<body> | |
<a href="click_me.html" id="click_me">Click me</a> | |
</body> | |
</html> |
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 Company | |
include MongoMapper::Document | |
key :name, String | |
key :bosses, Array | |
key :employees, Array | |
def promote!(employee) | |
add_to_set(:bosses, employee) |
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 loc = db.locations.findOne() | |
{ | |
"_id" : "0", | |
"coordinates" : { | |
"lng" : -74.94366060659561, | |
"lat" : 42.05198110294361 | |
}, | |
... | |
} | |
> var lat = loc["coordinates"]["lat"] |
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
<!-- Actual javascript code sample attached to resume -->` | |
<html> | |
<body> | |
<script type="text/javascript"> | |
document.write("<h1>Hello World!</h1>"); | |
</script> | |
</body> | |
</html> |