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
module Compass | |
module SassExtensions | |
module Functions | |
module ImageSize | |
end | |
end | |
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
[28] pry(#<Module>):2> show-method nav_class | |
From: /Users/cwoodcox/Projects/esa/app/helpers/shim/pages_helper.rb @ line 8: | |
Number of lines: 7 | |
Owner: Shim::PagesHelper | |
Visibility: public | |
def nav_class(section) | |
if current_section == section | |
"current-page" |
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
filter :workshop, collection: Workshop.with_registrations.collect {|w| [ "#{w.venue} – #{w.location}", w.id ]} |
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 'rack/rewrite' | |
use Rack::Rewrite do | |
rewrite '/', 'index.html' | |
end | |
run Rack::Directory.new(File.join File.dirname(__FILE__), '_site') |
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
curl -H "Accept: application/json" \ | |
> -u :$HEROKU_API_TOKEN \ | |
> -d "collaborator[email]=corey%2Ewoodcox%40gmail%2Ecom" \ | |
> -X POST https://api.heroku.com/apps/oc-little-nellie-prod/collaborators | |
[email protected] added as a collaborator on oc-little-nellie-prod. |
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
def create_stylesheet | |
stylesheet = StringIO.new | |
stylesheet << <<-EOS | |
@font-face { | |
font-family: 'badges'; | |
src: url('#{font_eot.url}'); | |
src: url('#{font_eot.url}') format('embedded-opentype'), | |
url('#{font_woff.url}') format('woff'), | |
url('#{font_ttf.url}') format('truetype'), | |
url('#{font_svg.url}') format('svg'); |
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
ack | |
autoconf | |
automake | |
cmake | |
cowsay | |
curl-ca-bundle | |
ec2-api-tools | |
fortune | |
fping | |
freetype |
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
module Shortwave | |
module Observable | |
def self.included(base) | |
base.send :include, InstanceMethods | |
end | |
module InstanceMethods | |
class Notification | |
attr_accessor :event, :id, :klass |
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 Policy | |
attr_reader :expires, :response | |
def initialize user | |
if user | |
@expires = 8.hours.from_now | |
content_length = 100..50.megabytes | |
user_id = user.email.split('@').reverse.join('/') | |
else | |
@expires = 30.minutes.from_now |
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
# Create the associations for individual body_metrics and accept their nested | |
# attributes. This makes the biometrics form work and a few other things. | |
Dir['app/models/body_metric/*.rb'].collect { |file| File.basename(file).sub /\.rb/, '' }.each do |metric| | |
has_one :"current_#{metric}", -> { latest }, class_name: "BodyMetric::#{metric.camelize}" | |
accepts_nested_attributes_for :"current_#{metric}" | |
define_method("current_#{metric}") do | |
super() || self.send(:"build_current_#{metric}") | |
end | |
end |