Skip to content

Instantly share code, notes, and snippets.

View davetron5000's full-sized avatar

David Copeland davetron5000

View GitHub Profile
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details

This is

class SomeRubyCode
end

Here is a diff

class HooksRegistry
def hooks(name)
end
def clear_hooks(name)
end
def register_hook(name, &block)
end

Here it is:

diff --git a/README.rdoc b/README.rdoc
index 2ff9aa6..b15475f 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -1,11 +1,5 @@
 = bookinggit
 
11:11:10 web.1 | started with pid 77035
11:11:10 compass.1 | started with pid 77036
11:11:10 web.1 | Configuration file: _config.yml
11:11:10 web.1 | Configuration file: _development_config.yml
11:11:10 web.1 | Source: /Users/davec/Projects/growingdevs.github.io
11:11:10 web.1 | Destination: /Users/davec/Projects/growingdevs.github.io/_site
11:11:10 web.1 | Generating... Conversion error: There was an error converting '_posts/2013-09-09-welcome-to-growingdevs-com.md/#excerpt'.
11:11:10 web.1 | error: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string). Use --trace to view backtrace
11:11:10 web.1 | exited with code 1
11:11:10 system | sending SIGTERM to all processes
@davetron5000
davetron5000 / bundler_assets.rb
Created April 10, 2014 14:21
This is my imagined way in which Bundler could manage front-end assets without having to wrap them first in RubyGems, but just deciding to use bower
source 'https://foobar@gem.fury.io/me/' # private gem repo
source 'https://rubygems.org' # canonical rubygems
asset_source 'https://foobar@hostedbower.io' # if someday this could exist
asset_source 'https://bower.io' # canonical bower sources
gem "rails" # gem == RubyGem, do what we do now
asset "angular" # look in Bower public server, using its API
asset "colors", git: "git@github.com:stitchfix/colors" # look in git repo for bower.json
asset "jquery", cdn: "code.jquery.com/jquery-1.11.0.min.js" # satisfies deps, but doesn't download anything
merch_date | merch_week_name | merch_year | merch_month | merch_quarter | merch_season
------------+-----------------+------------+-------------+---------------+---------------
2014-01-01 | Dec W5 | 2013 | Dec | Q2 | Fall / Winter
2014-01-02 | Dec W5 | 2013 | Dec | Q2 | Fall / Winter
2014-01-03 | Dec W5 | 2013 | Dec | Q2 | Fall / Winter
2014-01-04 | Dec W5 | 2013 | Dec | Q2 | Fall / Winter
2014-01-05 | Jan W1 | 2014 | Jan | Q2 | Fall / Winter
2014-01-06 | Jan W1 | 2014 | Jan | Q2 | Fall / Winter
2014-01-07 | Jan W1 | 2014 | Jan | Q2 | Fall / Winter
@davetron5000
davetron5000 / god.rb
Last active August 29, 2015 14:00
Since we don't need TDD anymore, this is the best way to write tests after you've hand-crafted your code to be beautiful
class God < ActiveRecord::Base
has_many :purchases
has_many :orders
has_many :login_attempts
has_many :friends
acts_as_taggable because: "all tags are the same"
scope :alive, -> { where.not(:status => :dead) }
scope :active, -> { where(:inactive => false) }
#!/usr/bin/env ruby
require 'methadone'
include Methadone::Main
include Methadone::CLILogging
main do |gem_name|
# ..
describe Person do
subject(:person) { Person.new(age: age) }
describe "minor?" do
context "over 18" do
let(:age) { 20 }
it { person.minor?.should == false }
end
context "under 18" do
let(:age) { 16 }
it { person.minor?.should == true }