Skip to content

Instantly share code, notes, and snippets.

View walter's full-sized avatar

Walter McGinnis walter

View GitHub Profile
@walter
walter / example-blog-route-handlers.coffee
Created February 7, 2013 03:29
Example blog application route handlers and the mixin they use
# see mixins/posts_formable below
App.PostsNewRoute = Ember.Route.extend App.PostsFormable,
# set up a new blank instance of Post for the form's content
model: ->
App.Post.createRecord()
# perhaps alternatively, this could use 'needs post' in controller
# for setting the model instance
App.PostEditRoute = Ember.Route.extend App.PostsFormable,
model: ->
@walter
walter / example-blog-form-view.coffee
Created February 11, 2013 18:34
example blog form view definition
# form view that matches posts.form template
App.PostsFormView = Em.View.extend
tagName: 'form'
classNames: 'modal fade in form-custom-field-modal'.w()
didInsertElement: ->
@$().modal 'show'
willDestroyElement: ->
@$().modal 'hide'
;; start server mode
(server-start)
### use emacsclient as editor
export EDITOR=/usr/local/bin/emacsclient
App = require 'app'
require 'models/provider'
require 'stores/provider'
# Sample test case
describe 'Provider', ->
describe '#create()', ->
# essentially this is testing that our configuration is working
# so somewhat of a redundant test
it 'should return a new Provider record matching input', ->
App = require 'app'
# see Ember Model: https://github.com/ebryn/ember-model
# for how this is set up
require 'models/provider'
require 'adapters/provider'
describe 'Provider', ->
describe '#create()', ->
# essentially this is testing that our configuration is working
# so somewhat of a redundant test
App = require 'app'
require 'helpers/markdown'
module 'Markdown Helper',
setup: ->
Ember.run App, App.advanceReadiness
teardown: ->
App.reset()
test '#markdown', ->
brew update
brew install zsh
sudo ln -s /etc/zshenv /etc/zprofile
# instead of just using chsh -s /bin/zsh (what comes with mac os x)
# symlink /bin/zsh to /usr/local/bin/zsh first
# as chsh -s /usr/local/bin/zsh isn't allowed
sudo mv /bin/zsh /bin/zsh-distribution-bak
sudo ln -s /usr/local/bin/zsh /bin/zsh
sudo chsh -s /bin/zsh
(setenv "ESHELL" "/usr/local/bin/zsh")
(setenv "SHELL" "/usr/local/bin/zsh")