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
test('selections should be populated as checkboxes are marked', function() { | |
expect(4); | |
var selections = Em.A(); | |
var testData = { | |
models: Em.A([ | |
Em.Object.create({ id: 1, name: "Foo", desc: "Hey"}), | |
Em.Object.create({ id: 2, name: "Bar", desc: "World"}), | |
]), | |
value: selections |
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 CsrfController < ApplicationController | |
def index | |
render json: { request_forgery_protection_token => form_authenticity_token }.to_json | |
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
NSURL *url = [NSURL URLWithString:@"file:////path_to_my.mp4"]; | |
AVPlayer *player = [AVPlayer playerWithURL:url]; | |
AVPlayerLayer *layer = [AVPlayerLayer playerLayerWithPlayer:player]; | |
[[self.playerView layer] insertSublayer:layer atIndex:0]; | |
[player play]; |
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
2013-08-28 22:19:58.119 JAMR[4798:70b] *** Assertion failure in -[NSLayoutConstraint _setSymbolicConstant:constant:], /SourceCache/Foundation_Sim/Foundation-1047.18.1/Layout.subproj/NSLayoutConstraint.m:545 | |
2013-08-28 22:19:58.307 JAMR[4798:70b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Constant is not finite! That's illegal. constant:nan' | |
*** First throw call stack: | |
( | |
0 CoreFoundation 0x033596f4 __exceptionPreprocess + 180 | |
1 libobjc.A.dylib 0x027de8b6 objc_exception_throw + 44 | |
2 CoreFoundation 0x03359558 +[NSException raise:format:arguments:] + 136 | |
3 Foundation 0x021b25ee -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116 | |
4 Foundation 0x0220ac49 -[NSLayoutConstraint _setSymbolicConstant:constant:] + 170 | |
5 Foundation 0x0220d671 -[NSLayoutConstraint setConstant:] + 52 |
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
#!/usr/bin/env ruby | |
# Take in a file | |
# Read each line | |
# if it contains a single #, then do a regexp replace to make it ### <text> ### | |
# | |
# Each file | |
ARGV.each do |file_name| | |
# Open the file read only so we can grab it's contents |
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
$(document).ready -> | |
if $("#contact-head").length | |
mochaleaf = new google.maps.LatLng(37.777901,-122.411996) | |
image = '/assets/ml.map.png' | |
mochaStyles = [ | |
featureType: "administrative" | |
elementType: "geometry" |
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
# Aliases | |
get = Ember.get | |
App.CacheAdapter = DS.Adapter.extend | |
# This defines our local storage adapter where we'll hold our cache stuff | |
localAdapterKlass: 'App.IDBAdapter' | |
# This defines our network storage adapter where we'll fetch/push/etc.. updates | |
networkAdapterKlass: 'DS.RESTAdapter' |
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
# Aliases | |
get = Ember.get | |
indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB | |
# Indexed DB Adapter | |
App.IDBAdapter = DS.Adapter.extend | |
# Name of the database store we're going to use | |
dbName: 'myCoolDB' | |
# Version of the schema |
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
indexdb notes | |
dbName = 'someName' | |
# obtain non-vendored versions of these | |
# Vars used to open / work with our db instance | |
window.db = null | |
request = indexedDB.open(dbName) |
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
it.only 'should recalculate when adding an element to the array with pushObject', -> | |
pipeline.get('results.length').should.equal(10) | |
newBook = Book.create( title: 'yolofolomolo' ) | |
pipeline.get('content').pushObject(newBook) | |
pipeline.get('results.length').should.equal(11) | |
pipeline.get('results.lastObject').should.equal(newBook) |