Skip to content

Instantly share code, notes, and snippets.

View nathancarnes's full-sized avatar

Nathan Carnes nathancarnes

View GitHub Profile
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
model() {
return {};
},
});
@nathancarnes
nathancarnes / gist:9cb9e3cf21dccace3a2e
Created February 10, 2015 00:25
An amazing library for feature flags in Rails
# Just put this into lib/, and add your methods!
# Usage: Features.your_feature_name?
class Features
# Admin-only features? We've got that!
def self.reticulate_splines?
current_user && current_user.admin?
end
# Don't want to deploy to flip it on or off? It supports that!
@nathancarnes
nathancarnes / SassMeister-input-HTML.html
Last active August 29, 2015 14:06
Generated by SassMeister.com.
<div class="box">
foo
</div>
<div class="panel">
hai
</div>
<div class="widget">
lolz
@nathancarnes
nathancarnes / SassMeister-input-HTML.html
Created September 10, 2014 19:45
Generated by SassMeister.com.
<div></div>

API Spec

POST /api/employers/trips

  • requires HTTP Basic authorization

Attributes

  • user_email -- users email required
class Channel
attr_accessor :name
def initialize(name)
@name = name
end
def silent?
# code here to determine whether or not the channel is silent
end
end
@nathancarnes
nathancarnes / task.rb
Last active December 14, 2015 19:48 — forked from amiel/task.rb
class Task < ActiveRecord::Base
belongs_to :project
validates_presence_of :project_id
validate do
unless project.status == 'funded'
errors.add(:base, 'Project must be funded')
end
end
$categories:
watersports-repair #ad1d17,
anti-fog #f25012,
clean-deodorize #881f7f,
wetsuit-drysuit-maintenance #738821,
dive-essentials #0072b7;
@each $category in $categories{
$class: nth($category, 1);
$color: nth($category, 2);
@nathancarnes
nathancarnes / gist:3948871
Created October 24, 2012 21:04
Install nokogiri 1.4.4
gem install nokogiri -v=1.4.4 -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.7.8/lib --with-xslt-dir=/usr/local/Cellar/libxslt/1.1.26 --with-iconv-include=/usr/local/Cellar/libiconv/1.13.1/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.13.1/lib