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
preloadImage = (image_data) -> | |
deferred = $.Deferred() | |
# preload the image, so it's ready to display | |
cache_bust = ( new Date() ).getTime() | |
img = new Image() | |
img.src = "#{image_data.src}?size=large&cachebust=#{cache_bust}" | |
# image has loaded, resolve deferred | |
$( img ).on 'load', -> |
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
(function() { | |
var app, ApplicationController; | |
ApplicationController = window.BaseController.extend({ | |
inject: ['$rootScope', 'MyService'], | |
initialize: function($scope, $rootScope, MyService) { | |
// (optional) intitialize stuff |
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
<form> | |
<fieldset> | |
<legend>Personal Information</legend> | |
<div class="form-group required"> | |
<label for="first-name">First Name:</label> | |
<div class="field"> | |
<input class="form-control" id="first-name" name="first-name"> | |
</div> | |
</div> |
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
{ | |
"enemy_clan_name": "Huge Assholes", | |
"sluggified_clan_name": "huge-assholes", | |
"result_display": ["Declared", "Ongoing", "Victory", "Defeat", "Tie"], | |
"friendly_stars": 15, | |
"enemy_stars": 12, | |
"friendly_attacks_used": 8, | |
"enemy_attacks_used": 6, | |
"starts_at": "2014-12-25 12:30:00+00:00", | |
"ends_at": "2014-12-26 12:30:00+00:00", |
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
### | |
possible schema | |
### | |
User | |
has_many :posts | |
has_many :tools | |
has_many :products, through: :tools | |
Post |
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
{ | |
"data": { | |
"id": "79931a85-9dda-42d8-8103-fea6ba4fc4af", | |
"type": "client", | |
"attributes": { | |
"name": "GrubHub", | |
"company-id": "grubhub", | |
"address": "111 W Washington St, Chicago, IL 60602", | |
"createdAt": "2016-01-20T18:40:46.000Z", | |
"updatedAt": "2016-01-21T23:25:58.000Z" |
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
import Ember from 'ember'; | |
import { moduleFor, test } from 'ember-qunit'; | |
let mockSession = Ember.Service.extend({ | |
isAuthenticated: true, | |
currentUser: Ember.computed('isAuthenticated', function() { | |
return Ember.RSVP.Promise(function(resolve) { | |
resolve( Ember.Object.create({ accounts: [] }) ); | |
}); | |
}) |
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 ApiConstraint | |
attr_reader :version | |
def initialize(options) | |
@version = options.fetch(:version) | |
end | |
def matches?(request) | |
request | |
.headers |
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
defaultAllChecked: false, | |
allValidItems: Ember.computed.oneWay( 'defaultAllChecked' ), | |
isAllChecked: Ember.computed('allValidItems', 'items.[]', function() { | |
return this.get('allValidItems.length') === this.get('items.length'); | |
}) | |
}); |