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 ItemsController < ApplicationController | |
def index | |
@items = Item.all | |
end | |
def create | |
@item = Item.new(allowable_params) | |
update_or_create @item, :save | |
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
module ModuleExtensions | |
refine String do | |
def foo | |
puts "bar" | |
end | |
end | |
end | |
class Poop |
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 something_fun(dump: "truck", tree: "hugger") | |
puts "#{dump} #{tree}" | |
end | |
something_fun |
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
RoflCopter.ApplicationController = Ember.Controller.extend({ | |
sharedBehavior: function() { | |
return "A winner is you!!!"; | |
}.property() | |
}); | |
RolfCopter.AnotherController = RoflCopter.ApplicationController.extend({ | |
importantStuff: function() { | |
var ohBeehave = this.get("sharedBehavior"); |
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
include ActionDispatch::Routing | |
include Rails.application.routes.url_helpers |
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
$cucumber_instance_variables = [] | |
Before do | |
$cucumber_instance_variables = instance_variables | |
end | |
After do | |
test_variables = instance_variables - $cucumber_instance_variables | |
message = "[WARN] the following test variables could be leaking #{leaked_variables.join(', ')}" |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#define too goto | |
int main( int argc, const char* argv[]) { | |
int times; | |
times = 0; | |
legit: | |
printf(" too legit,"); |
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
#!/usr/bin/env ruby | |
trap("INT") { puts "\ncatch'ya later"; exit 0 } | |
output = `git for-each-ref --count=10 --sort=-committerdate refs/heads/ --format='%(refname:short)'` | |
branches = output.split("\n") | |
unless option = ARGV[0] | |
puts <<-MSG |
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
migrate () { | |
local zeus_command="" | |
if _zeus-installed | |
then | |
zeus_command="zeus" | |
fi | |
$zeus_command rake db:migrate && $zeus_command rake db:rollback && $zeus_command rake db:migrate && $zeus_command rake db:test:prepare | |
} |
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 Message | |
MAX_LENGTH = 240 | |
... | |
end |