Use this to add events to your objects without needing any libaries.
Simple function can be imported or copy pasted. In your object constructor
assign your event functions to the return value of the createCustomEvent()
.
Simple example:
// | |
// Usage... for a nested structure | |
// var test = { | |
// nested: { | |
// value: 'Read Correctly' | |
// } | |
// }; | |
// safeRead(test, 'nested', 'value'); // returns 'Read Correctly' | |
// safeRead(test, 'missing', 'value'); // returns '' | |
// |
// add all items to collection | |
Alloy.Collections.Fugitive.reset([{ | |
"name" : "Jeff Haynie" | |
}, { | |
"name" : "Nolan Wright" | |
}, { | |
"name" : "Don Thorp" | |
}, { | |
"name" : "Marshall Culpepper" | |
}, { |
(function(settings, libraries) { | |
localStorage.setItem('settings', JSON.stringify(settings)); | |
localStorage.setItem('libraries', JSON.stringify(libraries)); | |
setTimeout(function() { | |
window.location = window.location; // Force refresh | |
}, 0); | |
})( | |
//Settings | |
{ | |
"panels": [ |
This is a brain dump of my experience trying to get something going with Ember.js. My goal was to get to know the ins and outs of the framework by completing a pretty well defined task that I had lots of domain knowledge about. In this case reproducing a simple Yammer feed. As of this time, I have not been able to complete that task. So this is a subjective rundown of the things I think make it difficult to get a handle on Ember. NOTE: My comments are addressing the Ember team and giving suggestions on what they could do to improve the situation.
The new guides have pretty good explanation of the various parts of the framework; routers, models, templates, views. But it's not clear how they all get strapped together to make something that works. There are snippets of examples all over the place like:
App.Router.map(function() {
match('/home').to('home');
});
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
# Title: Photos tag for Jekyll | |
# Authors: Devin Weaver | |
# Description: Allows photos tag to place photos as thumbnails and open in fancybox. Uses a CDN if needed. | |
# | |
# ** This only covers the markup. Not the integration of FancyBox ** | |
# | |
# To see an unabridged explination on integrating this with [FancyBox][1] | |
# Please read my [blog post about it][2]. | |
# | |
# [1]: http://fancyapps.com/fancybox/ |
#!/usr/bin/env bash | |
# Gist: https://gist.github.com/2509971 | |
# | |
# This is a psuedo-fork of [gnome-terminal-colors=solarized][1] | |
# The values were hard coded (where the above was modularized) for | |
# ease of using curl or wget to pull from a gist. | |
# | |
# curl https://raw.github.com/gist/2509971/solarized.sh | bash -s | |
# |