Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
items: [{
id: 0,
name: 'Root',
isExpanded: true,
isSelected: false,
import Ember from 'ember';
export default Ember.Component.extend({
_model: Ember.computed.oneWay('model'),
actions: {
itemChanged(node){
this.propagateDownwards(node)
this.propagateUpwards(node)
},
@Geokoumpa
Geokoumpa / gist:11365481
Created April 28, 2014 08:30
Ember-model findMany implementation
# this calls to a resource collection path adding an 'ids' param with comma separated ids, e.g. /posts?ids="1,2,3"
Ember.RESTAdapter.reopen findMany: (klass, records) ->
url = @buildURL(klass)
params = ids: records._ids.join(",")
@ajax(url, params).then (data) ->
collectionKey = Ember.get(klass, "collectionKey")
dataToLoad = (if collectionKey then Ember.get(data, collectionKey) else data)
@Geokoumpa
Geokoumpa / index.html
Created May 15, 2013 10:27
A CodePen by hoffmanjeff. Apple's border-radius shadow
<aside class="promos">
<ul>
<li class="first-child"><div class="curve-down">
<a class="promo1" href="/ipad/" style="display: none;" onclick="s_objectID=&quot;http://www.apple.com/ipad/_2&quot;;return this.s_oc?this.s_oc(e):true"><img src="http://images.apple.com/home/images/promo_ipad.png" alt="iPad. Two sizes do all." width="237" height="185"></a>
<a class="promo1" href="/iphone/" style="" onclick="s_objectID=&quot;http://www.apple.com/iphone/_2&quot;;return this.s_oc?this.s_oc(e):true"><img src="http://images.apple.com/home/images/promo_iphone5.png" alt="iPhone 5. Loving it is easy. That’s why so many people do." width="237" height="185"></a>
</div></li>
<li class="second-child"><div class="curve-down">
<a class="promo2" href="/iphone/videos/#tv-ads-photos-every-day" onclick="s_objectID=&quot;http://www.apple.com/iphone/videos/#tv-ads-photos-every-day_1&quot;;return this.s_oc?this.s_oc(e):true"><img src="http://images.apple.com/home/images/promo_iphone_ad_photoseveryday.png" alt="Watch the n
#
# Colors
#
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NORMAL="\[\033[0m\]"
#