Skip to content

Instantly share code, notes, and snippets.

View commadelimited's full-sized avatar

Andy Matthews commadelimited

View GitHub Profile
@commadelimited
commadelimited / ember-managing-dependencies.html
Last active August 29, 2015 13:56
Ember / Managing dependencies
Right now we have one main application file, all of our Ember code, and a utils file which
contains a number of helper functions. Those files, along with an assortment of 3rd party libs,
and our "core" libs (Ember (and Data), Handlebars), etc.
```
<script type="text/javascript">
head.js(
// Ember (and Data), Handlebars
"https://emma-social.s3.amazonaws.com/assets/js/libs/min/core.libs-min.js",
@commadelimited
commadelimited / adjust.svg
Last active August 29, 2015 13:56
Problem CSS
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@commadelimited
commadelimited / ember-testing-promises.js
Last active August 29, 2015 13:57
ember-testing-promises
describe("reports", function () {
before(function() {
Ember.run(Social, Social.advanceReadiness);
});
afterEach(function() {
Social.reset();
});
### Keybase proof
I hereby claim:
* I am commadelimited on github.
* I am commadelimited (https://keybase.io/commadelimited) on keybase.
* I have a public key whose fingerprint is 96B5 FCF6 F592 664C 58D5 0984 B7F3 0A64 5ECE C704
To claim this, I am signing this object:
@commadelimited
commadelimited / _readme.md
Last active August 29, 2015 13:58
Problem running mocha tests with PhantomJS through Grunt

I'm trying to set up my unit tests so that I can run them from Grunt using mocha_phantomjs. I can run them directly from the command line with the following statement:

mocha-phantomjs /test/helpers.html

and get the following output:

 Helpers
@commadelimited
commadelimited / PeopleController.js
Created April 11, 2014 13:41
Data loads, never displays
App.PeopleController = Ember.ArrayController.extend({
sortAscending: true,
sortProperties:['First', 'Last'],
init: function(){
debugger;
}
});
@commadelimited
commadelimited / _readme.md
Last active August 29, 2015 14:00
Ember Qunit Testing

I'm updating my unit tests to use the new Ember-QUnit approach and I'm running into a problem with one computed property test.

I'm trying to test that hire_date returns the correct string, but the test keeps failing with undefined is not a function. I know the setup is correct because another test, location_class, works just fine.

Can anyone offer insight as to why this is failing?

Source: 	
TypeError: undefined is not a function
    at null.<anonymous> (http://0.0.0.0:8844/app/js/application.js:146:29)
  • Save random_wiki.py to your desktop
  • Run pip install pyquery
  • In your terminal run python wiki.py | say
  • Enjoy
@commadelimited
commadelimited / _readme.md
Last active August 29, 2015 14:02
Application template outlet doesn't populate

With these two files in place (all dependencies met) I load the page at http://127.0.0.1:8000/ and get only the h1 (which is outside of the template). There are no errors, just emptiness. if I uncomment the renderTemplate method the content loads. On a side note, my models are not populating but I'm getting there.

My debug block:

DEBUG: Ember                          : 1.5.1 core.js:6268
DEBUG: Ember Data                     : 1.0.0-beta.8.2a68c63a core.js:6268
DEBUG: Handlebars                     : 1.3.0 core.js:6268
DEBUG: jQuery                         : 2.0.3 core.js:6268
DEBUG: ember-data-django-rest-adapter : 1.0.3 
// An existing code sample I have uses cURL (found below).
// But is there a reason why someone would use the second example instead of the first example?
// They both appear to do the exact same thing, but the first one is MUCH simpler.
// Thoughts?
<?php
$response = file_get_contents("http://feeds.arstechnica.com/arstechnica/index?format=xml");
print_r($response);
?>