Skip to content

Instantly share code, notes, and snippets.

@janusch
janusch / gist:8e50fc205b2d0a9448f6
Created September 4, 2015 09:22
reducer add to object in object array
case GET_USERS:
return [...action.payload];
//payload looks like: [{id: 1, name: blah, age: 30}{id: 2, name: blub, age: 20}]
case GET_USER_PROPS:
//payload looks like: {prop1: foo, prop2: bar, ...}
//i tried this, with lodash merge, but as expected that creates a new object, whereas i want an array of objects.
return merge({}, state, action);
@janusch
janusch / gist:6898376
Last active December 25, 2015 01:49
Reading list and Book wishes
## Book wishes
### Infrastructure
- Test-Driven Infrastructure with Chef: http://shop.oreilly.com/product/0636920030973.do
- The Chef Survival Guide: https://leanpub.com/chef-survival-guide
### Rails
- http://www.confidentruby.com/
- http://exceptionalruby.com/
@janusch
janusch / gist:6006670
Last active December 19, 2015 19:29
What is the correct way to save records in Embah?
//1.
WeekPresence.get('transaction').commit();
//2.
WeekPresences.pushObject(WeekPresence);
//3.
var WeekPresence = Haps.WeekPresence.createRecord({
monday: this.set('model.monday', value),
tuesday: this.get('model.tuesday'),
@janusch
janusch / gist:5899020
Last active December 19, 2015 04:39
Ember Resources
== Comparison of MVCs - Ember vs. Rails
http://jeffreybiles.com/blog/much-very-confused.html
@janusch
janusch / gist:5803482
Created June 18, 2013 08:03
Sublime Text 2 - useful add-ons, themes, colors, custom user preferences and keys. (feel free to add) (also feel free to add your custom key bindings - so we might find a common ground for setup on mac)
== Install Package Manager
paste code into ST console:
import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print('Please restart Sublime Text to finish installation')
== Plugin Suggestions (add yours)
SideBarEnhancements