(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
App.Cache = Em.Object.extend | |
init: -> | |
@store = App.__container__.lookup('store:main') | |
# tries to load the results from localforage cache or from normal adapter | |
findAll: -> | |
localforage.getItem(@modelStr).then (cacheItems)=> | |
if Em.isEmpty(cacheItems) | |
@findAndCache() | |
else |
import Ember from "ember"; | |
var get = Ember.get; | |
var copy = Ember.copy; | |
var removeObserver = Ember.removeObserver; | |
var addObserver = Ember.addObserver; | |
var DocumentTitleMixin = Ember.Mixin.create({ | |
titleTokensDidChange: function () { |
// Get the active Media Query as defined in the CSS | |
// Use the following format: | |
// #getActiveMQ-watcher { font-family: "default"; } | |
// @media only screen and (min-width:20em){ #getActiveMQ-watcher { font-family: "small"; } } | |
// etc. | |
window.getActiveMQ = function() { | |
// Build the watcher | |
var $watcher = document.createElement('div'), | |
// alias getComputedStyle | |
computed = window.getComputedStyle, |
// This code accompanies a blog post: http://chris.eidhof.nl/posts/json-parsing-in-swift.html | |
// | |
// As of Beta5, the >>= operator is already defined, so I changed it to >>>= | |
import Foundation | |
let parsedJSON : [String:AnyObject] = [ | |
"stat": "ok", | |
"blogs": [ |
// ---- | |
// Sass (v3.3.10) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
// ----------------------------------------------------------------------------- | |
// Introduction | |
// ----------------------------------------------------------------------------- | |
// Here is hacky and experimental solution for cross-scopes extends |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>SVG Test</title> | |
</head> | |
<body> | |
<svg id="s" version="1.1" | |
width="300" height="300" | |
xmlns="http://www.w3.org/2000/svg"> |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
var User = DS.Model.extend({ | |
messages: DS.hasMany('message', {polymorphic: true}) | |
}); | |
var Message = DS.Model.extend({ | |
user: DS.belongsTo('user'), | |
body: DS.attr() | |
}); | |
var Post = Message.extend({ |
/* Put your CSS here */ | |
html, body { | |
margin: 20px; | |
} | |
.color { | |
height: 200px; | |
width: 200px; | |
} |