I hereby claim:
- I am mrinterweb on github.
- I am mrinterweb (https://keybase.io/mrinterweb) on keybase.
- I have a public key whose fingerprint is B61F E9FA FF8E 7B3F 1635 98AE DF00 B371 6395 D7EB
To claim this, I am signing this object:
| Calculating ------------------------------------- | |
| select + include 30.000 i/100ms | |
| sort + select + bsearch | |
| 138.000 i/100ms | |
| presorted: select + bsearch | |
| 207.000 i/100ms | |
| ------------------------------------------------- | |
| select + include 306.578 (± 4.9%) i/s - 1.530k | |
| sort + select + bsearch | |
| 1.387k (± 5.1%) i/s - 7.038k |
| App.Cache = Em.Object.extend | |
| init: -> | |
| @store = App.__container__.lookup('store:main') | |
| # tries to load the results from localforage cache or from normal adapter | |
| findAll: -> | |
| localforage.getItem(@modelStr).then (cacheItems)=> | |
| if Em.isEmpty(cacheItems) | |
| @findAndCache() | |
| else |
| App.FriendCache = Em.Object.extend | |
| init: -> | |
| @store = App.__container__.lookup('store:main') | |
| findAll: -> | |
| localforage.getItem('friends').then (cfriends)=> | |
| if Em.isEmpty(cfriends) | |
| @findAndCache() | |
| else | |
| allFriends = @store.all('friend') |
| App.ApplicationAdapter = DS.ActiveModelAdapter.extend | |
| namespace: 'api/v1' | |
| host: App.BaseUrl | |
| setHeaders: (-> | |
| console.log "setting headers", @get('currentSession.token') | |
| @set('headers', | |
| token: @get('currentSession.token') | |
| Accept: 'application/json' | |
| ) | |
| ).observes('currentSession.token').on('init') |
| # This is a demonstration of how to have the attribute friend_ids serialized | |
| # when posted to the server | |
| # Add friends like this in the controller: | |
| # group = @get('model') | |
| # friend = @store.getById('friend', friend.get('id')) | |
| # group.get('friends').addObject(friend) | |
| # group.save() | |
| App.Group = DS.Model.extend | |
| friends: DS.hasMany 'friend', async: true |
| #! /usr/bin/env ruby | |
| # Some of the words are misspelled to help the say program pronounce them right | |
| # | |
| # copy the following line and paste for fun! | |
| # curl -O https://gist.githubusercontent.com/mrinterweb/0ed2ac30a97e25e03fad/raw/5da7c2a012a08cfcc9649e0f410d53f8986e4990/speak.rb && mv speak.rb speak && chmod a+x speak && ./speak | |
| greetings = [ | |
| 'ahoy', | |
| 'greeting', | |
| 'saalutations', |
| #! /usr/bin/env ruby | |
| # nokogiri is required below unless --no-modify option is specified | |
| require 'optparse' | |
| require 'tempfile' | |
| @options = {} | |
| OptionParser.new do |opts| | |
| opts.banner = "Usage: svgoptimize [options] <path-to-svg-file>" |
I hereby claim:
To claim this, I am signing this object:
| module 'routing specs', | |
| setup: -> | |
| teardown: -> | |
| App.reset() | |
| require ['testingHelper'], (testingHelper)-> | |
| test 'root route', -> | |
| testingHelper.routesTo('/', 'index') |