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
App.UsersController = Ember.ArrayController.extend({ | |
sortProperties: ['name'], | |
sortAscending: true, | |
reSort: function(sortBtnValue) { | |
var sortProperty = this.get('sortProperties')[0]; | |
if (sortProperty == sortBtnValue) { | |
if (this.get('sortAscending')) { | |
this.set('sortAscending', false); | |
} else { |
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
var get = Ember.get; | |
/** | |
* @extends Ember.Mixin | |
* | |
* Implements common filter / sort / pagination behavior for array controllers | |
* */ | |
Ember.FilterSortSliceMixin = Ember.Mixin.create({ | |
filterBy: '', |
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
require 'singleton' | |
# outputs a colored call-trace graph to the Rails logger of the lines of ruby code | |
# invoked during a single request. | |
# | |
# Example: | |
# | |
# 1) Make sure this file is loaded in an initializer | |
# | |
# 2) Add the following to your application.rb in Rails3: |
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
require 'RMagick' | |
require 'capybara' | |
require 'launchy' | |
module Capybara::Recording | |
def start_recording | |
system "rm -f tmp/*" | |
end | |
def save_recording |
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
//our app | |
var HelloEmber = Ember.Application.create({}); | |
//our model | |
HelloEmber.Greeting = Ember.Object.extend(); | |
HelloEmber.Greeting.reopenClass({ | |
get : function(){ | |
return {greeting : "Good Morning Starshine!", happyThought : "The Earth Says Hello!"} | |
} | |
}); |
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
return Ember.RSVP.Promise(function (resolve, reject) { | |
var hash = { | |
url: geocodeUrl + "/" + params.latlng, | |
dataType: "jsonp", | |
jsonp: "jsonp", | |
data: { | |
key: apiKey, | |
includeEntityTypes: "Address" | |
} | |
}; |
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
# http://stackoverflow.com/questions/14972253/simpleform-default-input-class | |
# https://github.com/plataformatec/simple_form/issues/316 | |
inputs = %w[ | |
CollectionSelectInput | |
DateTimeInput | |
FileInput | |
GroupedCollectionSelectInput | |
NumericInput | |
PasswordInput |
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
<p>Here comes the <b>bindable HTML</b> popover contents!!!</p> | |
<p>Number: {{number}}</p> |
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
'use strict' | |
# dependencies angularjs, karma, karma-mocha, mocha, chai | |
describe 'Unit: $q.all', () -> | |
it 'should simulate promise', inject ($q, $rootScope) -> | |
deferred1 = $q.defer() | |
promise1 = deferred1.promise | |
deferred2 = $q.defer() |
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
require 'yaml' | |
example_vars = YAML.load_file('config/application.example.yml').keys | |
live_vars = Rails.env.production? ? (ENV.keys & example_vars) : YAML.load_file('config/application.yml').keys | |
unless live_vars.sort == example_vars.sort | |
raise 'There is a mismatch between application.yml and application.example.yml' | |
end |
OlderNewer