- update docs that use {{#each controller}} to {{#each model}} and/or explain the difference.
- assert errors or log debug info when templates reference undefined attributes in development
- need larger project examples of ember in live use for a production application. docs are inconsistent and too shallow on scope
- Horrible gotchya: Passing a second argument to {{render}} creates a new controller (like {{control}} would) rather than reusing the existing one (without warning or documentation). This makes perfect sense once you understand it, but there's no indication that this is happening except that properties you set on the controller are missing. I'd love a developer mode that tells you everything Ember is generating silently for you (controllers, routes, new instances, missing attributes, etc)
- defining a route with nothing in it is not the same as the auto generated one (it overwrites the default setupController or model?). No ideas why.
- attributes absolutely need a readOn
This file contains hidden or 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 bash | |
| export RUBY_HEAP_MIN_SLOTS=800000 | |
| export RUBY_HEAP_FREE_MIN=100000 | |
| export RUBY_HEAP_SLOTS_INCREMENT=300000 | |
| export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
| export RUBY_GC_MALLOC_LIMIT=79000000 | |
| alias flow='ps vx | grep -iE "\b(adium|messages|mail|skype|twitter|propane|flint|sparrow)\b" | grep -v grep | cut -f1 -d" " | xargs kill; osascript -e "tell Application \"iTunes\" to play" 2&> /dev/null; echo "FLOW MODE ENABLED: Distractions closed; tunes playing"' | |
| alias flowish='ps vx | grep -iE "\b(mail|skype|twitter|propane|flint|sparrow)\b" | grep -v grep | cut -f1 -d" " | xargs kill; osascript -e "tell Application \"iTunes\" to play" 2&> /dev/null; echo "FLOW MODE ENABLED: Distractions closed; tunes playing"' | |
| export HISTFILESIZE=100000 |
This file contains hidden or 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
| # insert at the top of boot.rb for FUN! | |
| require 'benchmark' | |
| $level ||= 0 | |
| $file ||= File.open('require_tree.log', 'w') | |
| $pending_writes = [] | |
| Object.class_eval do | |
| def __trace_requires(arg, &block) | |
| val = nil | |
| time = nil | |
| $pending_writes << [$level, arg] |
This file contains hidden or 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
| require 'test_helper' | |
| class ARFactory | |
| def self.new(table_name) | |
| Class.new(ActiveRecord::Base) do | |
| self.table_name = table_name | |
| end | |
| end | |
| end |
This file contains hidden or 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
| # given eye color distribution from: | |
| # http://www.statisticbrain.com/eye-color-distribution-percentages/ | |
| # ignoring the yellow specs, basically: | |
| # blue 32%, green 12%, brown 41% = 85% | |
| # thus.. | |
| # blue 38%, green 14%, brown 48% = 100% | |
| # | |
| # also given the image from here.. | |
| # https://twitter.com/scienceporn/status/322099933484314624 | |
| # |
This file contains hidden or 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
| App.SortedElementsView = Ember.View.extend Ember.TargetActionSupport, | |
| target: Ember.computed.alias('controller') | |
| action: 'sort' | |
| classNames: ['sorted-elements'] | |
| attributeBindings: ['id', 'fields'] | |
| elementClass: 'sortable-element' | |
| didInsertElement: () -> | |
| elements = ".#{@get('elementClass')}" | |
| Em.run.next () => | |
| hookupSortable = () => |
This file contains hidden or 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
| module StateMachine | |
| def self.included(klass) | |
| klass.send(:extend, ClassMethods) | |
| klass.instance_eval do | |
| after_initialize :set_initial_state | |
| end | |
| end | |
| module ClassMethods | |
| def state_column |
This file contains hidden or 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
| App.User = DS.Model.extend | |
| name: DS.attr 'string' | |
| email: DS.attr 'string' | |
| # dynamically defined properties are serialized as a string of JSON here: | |
| optionsString: DS.attr 'string' | |
| # optionsData lets us deal with the string as a JSON object | |
| optionsData: ((k,v) -> | |
| if arguments.length == 2 | |
| @set('optionsString', JSON.stringify(v)) |
This file contains hidden or 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
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: unicorn | |
| # Required-Start: $remote_fs $syslog | |
| # Required-Stop: $remote_fs $syslog | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Manage unicorn server | |
| # Description: Start, stop, restart unicorn server for a specific application. | |
| ### END INIT INFO |
This file contains hidden or 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
| upstream unicorn { | |
| server unix:/var/run/.unicorn.sock fail_timeout=0; | |
| } | |
| server { | |
| listen 80 default_server deferred; | |
| server_name example.com; | |
| root /home/username/apps/projectname/current/public; | |
| location ^~ /assets/ { |