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
perl -e '@_=(shift,pop);$*={ord"<"=>[sub{printf"%s",shift;join$&, | |
@ARGV[$.,$|]}]};$\=(($,)=$"=~?( )?)&&qq; $_[$#_]\n;;print+chop$,, | |
$*->{$=}->[$[]->($_)foreach($_[$|++]);' Just another Perl hacker, |
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
(function(Ext){ | |
// contents of ext-all.js | |
})(this.Ext4_2 || (this.Ext4_2 = {})); |
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 ErrorsController < ApplicationController | |
layout 'errors' | |
caches_page :show | |
def show | |
render action: params[:id] | |
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
class Article < ActiveRecord::Base | |
has_many :comments | |
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
on menuselect(menuName, itemName) | |
tell application "BBEdit" | |
if (length of (selection of text window 1) > 0) then | |
return false | |
else | |
set documentMode to source language of text document 1 | |
if (documentMode is "Ruby" or documentMode is "Unix Shell Script") then | |
set commentDelimiter to "# " | |
else | |
set commentDelimiter to "// " |
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
// set the parent container's height to the height of its tallest child | |
var $container = $("..."); | |
var max_height = 0; | |
$container.children("section").each(function (){ | |
max_height = Math.max(max_height, $(this).height()); | |
}); | |
$container.height(max_height); |
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
# app/models/address.rb | |
class Address < ActiveRecord::Base | |
end | |
# app/models/event.rb | |
class Event < ActiveRecord::Base | |
belongs_to :address | |
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
describe ChildrenController | |
belongs_to :parent | |
describe "GET :index" do | |
before(:each) do | |
@children = stub_index(Child) | |
end | |
it_should_find_and_assign :children | |
it_should_render_template "index" |
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
describe ChildrenController do | |
before(:each) do | |
@parent = mock(Parent, :id => 1) | |
@children = mock("children") | |
@parent.stub!(:children).and_return(@children) | |
Parent.should_receive(:find).with(@parent.id.to_s).and_return(@parent) | |
end | |
def expect_children_build | |
@children.should_receive(:build).with(any_args()).and_return(@child) |