Skip to content

Instantly share code, notes, and snippets.

View nathancarnes's full-sized avatar

Nathan Carnes nathancarnes

View GitHub Profile
@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
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

API Spec

POST /api/employers/trips

  • requires HTTP Basic authorization

Attributes

  • user_email -- users email required
@nathancarnes
nathancarnes / SassMeister-input-HTML.html
Created September 10, 2014 19:45
Generated by SassMeister.com.
<div></div>
@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 / 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!
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
model() {
return {};
},
});