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
function BaseballGame(home_team_name, away_team_name) { | |
var home_goals = 0; | |
var away_goals = 0; | |
function home_team_run_scored() { | |
home_goals++; | |
} | |
function away_team_run_scored() { |
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
[ | |
"$hit", | |
"$hit$", | |
"$hits", | |
"$hitted", | |
"$hitter", | |
"$hitting", | |
"3some", | |
"53x", | |
"60 nine", |
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 CarLot = { | |
name: 'We-Buy-Cars', | |
length: 0, | |
buy: function(num) { | |
return Array.prototype.push.call(this, num); | |
}, | |
sell: function() { | |
return Array.prototype.pop.call(this); | |
}, | |
report: function() { |
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
Autotest.add_hook :initialize do |at| | |
%w{log coverage}.each {|exception| at.add_exception(exception)} | |
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
describe 'ArticleDecorator' | |
describe '#opengraph_image_url' do | |
it 'should provide the default image as a fallback' do | |
request = stub(host: 'local.example.com', port: 3000) | |
ArticleDecorator.any_instance.stub request: request | |
ArticleDecorator.new(Article.new).opengraph_image_url.should == "http://local.example.com:3000/images/default.png" | |
end | |
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
= render template: "layouts/sub_layout" | |
- content_for :content_body | |
h3 'action.html.slim' |
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
<?php | |
namespace CI\Twig; | |
use Silex\Application; | |
class AssetTwigExtension extends \Twig_Extension | |
{ | |
private $CDN = null; |
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
event = [...] | |
@events = { | |
in_progress: events.select { |event| event.state == "in-progress" } || [], | |
pregame: events.select { |event| event.state == "pregame" } || [], | |
final: events.select { |event| event.state == "final" } || [] | |
} |
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 'ostruct' | |
module MyModule | |
class MyClass < OpenStruct | |
end | |
end | |
#`<module:MyModule>': uninitialized constant OpenStruct (NameError) |
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
class Event | |
attr_reader :uid, :event_date, :sports | |
def initialize(args) | |
args.keys.each do |name| | |
instance_variable_set "@" + name.to_s, args[name] | |
end | |
end | |
end |