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
class Controller { | |
var changed: (() -> Void)? | |
init() { | |
print("Allocate 'Controller'") | |
} | |
deinit { | |
print("Deallocate 'Controller'") | |
} |
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
commit 074a79b95e66d999abe500051c5337805575ea3f | |
Author: Jake Craige <james.craige@gmail.com> | |
Date: Tue Apr 7 10:14:29 2015 -0700 | |
Add testing infastructure for React components | |
diff --git a/app/controllers/components_controller.rb b/app/controllers/components_controller.rb | |
new file mode 100644 | |
index 0000000..4ffc308 | |
--- /dev/null |
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
Ea.GplacesAutocompleteComponent = Em.Component.extend | |
tagName: 'input' | |
classNames: ['google_places_ac'] | |
attributeBindings: ['placeholder', 'type', 'value'] | |
type: 'text' | |
didInsertElement: -> | |
autocomplete = new google.maps.places.Autocomplete($('.google_places_ac')[0], {}) | |
#Fast click fix for gmaps | |
g_autocomplete = $('body > .pac-container').filter(":visible") |
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
function getAll(collection, res){ | |
collection.list(function(err, resModels, options){ | |
var results = [], pages; | |
if(err) { | |
console.log(err); | |
res.send(500); | |
} | |
console.log('page 1'); | |
results.push(resModels); |
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
Em.ArrayProxy.createWithMixins Ember.SortableMixin, { | |
content: @get('contacts') | |
sortProperties: ['sort_key'] | |
sortAscending: true | |
} |
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
Ea.EventController = Em.ObjectController.extend | |
actions: | |
destroyEvent: -> | |
success = (resModel)=> | |
Ea.get('flash').randSuccess 'success.deleted' | |
error = -> | |
Ea.get('flash').randAlert 'error.general' |
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
EventAssist.EventsController = Em.ArrayController.extend Ea.ErrorFormatter, | |
actions: | |
createEvent: -> | |
event = @get('newEvent') | |
success = (savedEvent)=> | |
@transitionToRoute('event.overview', savedEvent) | |
Ea.get('flash').randAuccess 'success.created.event' | |
event.save().then success, (response)=> | |
@setErrors(response) |
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
class Travel < AdditionalInformation; end | |
[:test, :bob].each_with_object({}) do |key, res| | |
res[key] = params[key] if params[key] | |
end |
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
saveNewPhoto: -> | |
newImage = @store.createRecord 'event_image', { | |
image: @get 'newPhotoImage' | |
caption: @get 'newPhotoCaption' | |
event: @get 'model' | |
} | |
newImage.save().then ((img)=> | |
@get('event_images').pushObject img | |
Ea.get('flash').success 'Image added' | |
), (=> |
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
"Jake Craige & Matthew Hager | |
" Setup {{{ | |
set rtp+=~/.poetic_dotfiles/powerline/powerline/bindings/vim/ | |
if filereadable(expand("~/.vimrc.bundles")) | |
source ~/.vimrc.bundles | |
endif | |
filetype plugin indent on | |
" }}} |