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:
This is a flipping file | |
Barg! | |
This is a frikin RAD tool |
require 'spec_helper' | |
describe "root path", js: true do | |
before do | |
visit '/' | |
end | |
it "should have some content on the page" do | |
expect(page).to have_content 'Welcome to a special site' | |
end |
module 'routing specs', | |
setup: -> | |
teardown: -> | |
App.reset() | |
require ['testingHelper'], (testingHelper)-> | |
test 'root route', -> | |
testingHelper.routesTo('/', 'index') |
I hereby claim:
To claim this, I am signing this object:
#! /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', |
# 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 |
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') |
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.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 |