This file contains hidden or 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
--- peepcode-ember-final/js/app.js 2013-02-23 00:37:57.000000000 -0500 | |
+++ peepcode-ember-starter-app/js/app.js 2013-09-14 20:50:24.000000000 -0400 | |
@@ -17,13 +17,13 @@ | |
App.ApplicationRoute = Ember.Route.extend({ | |
setupController: function() { | |
- this.controllerFor('food').set('model', App.Food.find()); | |
+ this.controllerFor('food').set('model', this.store.find('food')); | |
} | |
}); |
This file contains hidden or 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
[ | |
{ | |
"created_at": "2012-12-07T07:15:00Z", | |
"first_name": "Janice", | |
"id": 1, | |
"last_name": "Resnick", | |
"riding": "Ajax--Pickering", | |
"updated_at": "2012-12-07T07:15:00Z" | |
}, | |
{ |
This file contains hidden or 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
$.getJSON("http://www.reddit.com/r/" + subreddit + "/.json?jsonp=?").then(function(response) { | |
var links = []; | |
response.data.children.forEach(function (child) { | |
links.push(App.RedditLink.create(child.data)); | |
}); | |
return links; | |
}).then(function(data){ | |
console.log(data)} | |
); |
This file contains hidden or 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
App.RedditLink.reopenClass({ | |
/* Use the Reddit JSON API to retrieve a list of links within a subreddit. Returns | |
a promise that will resolve to an array of `App.RedditLink` objects */ | |
findAll: function(subreddit) { | |
return $.getJSON("http://www.reddit.com/r/" + subreddit + "/.json?jsonp=?").then(function(response) { | |
var links = []; | |
response.data.children.forEach(function (child) { | |
links.push(App.RedditLink.create(child.data)); |
This file contains hidden or 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
App.RedditLink = Ember.Object.extend({ | |
/* | |
It seems reddit will return the string 'default' when there's no thumbnail present. | |
This computed property will convert 'default' to null to avoid rendering a broken | |
image link. | |
*/ | |
thumbnailUrl: function() { | |
var thumbnail = this.get('thumbnail'); | |
return (thumbnail === 'default') ? null : thumbnail; |
This file contains hidden or 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
$('.nav-button').on('click', function(e){ | |
//clear div, insert loading spinner | |
$content_div.html(spinner_html); | |
$.ajax({ | |
url: $(this).data('ajax-url'), | |
success: function(data){ | |
$('#the-fucking-spinner').remove(); | |
$content_div.append(data); | |
} |
This file contains hidden or 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
// ==UserScript== | |
// @name Merzo Drag | |
// @namespace https://gist.github.com/raw/1988543/merzo_drag.user.js | |
// @include http://merzo.net/* | |
// @include http://*.merzo.net/* | |
// | |
// | |
// ==/UserScript== | |
// |
This file contains hidden or 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
/* | |
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* | |
* - Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* |
This file contains hidden or 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
// ==UserScript== | |
// @name GitHub Anonymizer | |
// @namespace https://gist.github.com/raw/1262754/github_anonymizer.user.js | |
// @include http*://github.com/* | |
// | |
// | |
// ==/UserScript== | |
// | |