Skip to content

Instantly share code, notes, and snippets.

View sheldonbaker's full-sized avatar

Sheldon Baker sheldonbaker

View GitHub Profile
@charset "UTF-8";/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */@import url(https://fonts.googleapis.com/css?family=Share+Tech+Mono);html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{background:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-
** [Bugsnag] Notification to https://notify.bugsnag.com finished, response was 200, payload was {"apiKey":"eb0b9919e0100230f713e4d7e4f6e933","notifier":{"name":"Ruby Bugsnag Notifier","version":"2.8.12","url":"http://www.bugsnag.com"},"events":[{"app":{"version":null,"releaseStage":"development","type":"rails"},"context":"explorees#index","user":{"id":1594,"email":"micah+222@lateral.ly","profile_type":"FirmUser","profile_name":"Lateral.ly Recruiting"},"payloadVersion":"2","exceptions":[{"errorClass":"RuntimeError","message":"wtf","stacktrace":[{"inProject":true,"lineNumber":17,"code":{"14":" private","15":"","16":" def collection","17":" raise 'wtf'","18":" @query = ExploreeFinder.new(params, current_user).finder","19":" @query.merge!(super)","20":" if ordered_by_association?"},"file":"app/controllers/explorees_controller.rb","method":"collection"},{"inProject":true,"lineNumber":60,"code":{"57":" end","58":"","59":" def index","60":" respond_with collection","61":" end","62":"","63":" def
@sheldonbaker
sheldonbaker / 1-policy.coffee
Last active June 24, 2016 02:37
s3 image upload with ember-data - requires a Policy model (required by Amazon for browser uploads) generated by your server
`import DS from 'ember-data'`
# https://aws.amazon.com/articles/1434
Policy = DS.Model.extend
key: DS.attr('string')
bucket: DS.attr('string')
acl: DS.attr('string')
'AWSAccessKeyId': DS.attr('string')
'Content-Type': DS.attr('string')
@sheldonbaker
sheldonbaker / recurrence-form.coffee
Last active August 29, 2015 14:06
recurrence-form component - for usage with https://github.com/jakubroztocil/rrule
`import Ember from 'ember'`
RecurrenceFormComponent = Ember.Component.extend
tagName: 'fieldset'
minEndsOn: null
maxEndsOn: null
value: ((key, value) ->
if arguments.length > 1
class Company < ActiveRecord::Base
has_many :users
end
class User < ActiveRecord::Base
belongs_to :company
end
class Thing < ActiveRecord::Base
belongs_to :company
@sheldonbaker
sheldonbaker / app.coffee
Last active February 20, 2017 11:07
A model and a couple adapters to enable batch requests against a rails-api server implementing https://github.com/arsduo/batch_api. Uses Ember.RSVP.defer() extensively to allow a BatchAdapter to call `save` against multiple records and fire off a single AJAX request.
batch = store.createRecord('batch')
foo1 = store.createRecord 'foo',
title: 'I am a foo'
foo2 = store.createRecord 'foo',
title: 'I am another foo'
promise1 = batch.saveRecord(foo1).then (foo) ->
console.log(foo)
class Video < ActiveRecord::Base
inherits_from :item
end
class Article < ActiveRecord::Base
inherits_from :item
end
class Item < ActiveRecord::Base
has_many :responses
(function n(e){e.eq(0).fadeIn(99,function(){n(e.slice(1))})})($(":visible").hide())