Skip to content

Instantly share code, notes, and snippets.

View gabrielgrant's full-sized avatar

Gabriel Grant gabrielgrant

View GitHub Profile
import Ember from 'ember';
import AFrame from 'aframe';
import Animation from 'npm:aframe-animation-component';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@gabrielgrant
gabrielgrant / controllers.application.js
Last active March 3, 2018 03:33
Unsuccessful attempt to repro Awesome Macros Error
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
@gabrielgrant
gabrielgrant / controllers.application.js
Last active January 16, 2019 15:54
Checkbox Focus test
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Checkbox focus test',
actions: {
focusInAction() {
let args = Array.from(arguments)
let alerts = this.get('alerts');
this.set('alerts', alerts + '\nFocused: ' + args.join(', '));
@gabrielgrant
gabrielgrant / controllers.application.js
Last active January 17, 2018 03:44
ember-drag-drop state error
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
dragCoordinator: Ember.inject.service(),
actions: {
hide() {
this.set('hidden', true);
}
}
@gabrielgrant
gabrielgrant / components.x-recurse.js
Last active January 13, 2018 02:07
Recursive render
import Ember from 'ember';
export default Ember.Component.extend({
});
@gabrielgrant
gabrielgrant / components.child-component.js
Last active April 21, 2017 02:21
Component template inheritance
import Ember from 'ember';
import Parent from './parent-component';
export default Parent.extend({
foo: 'bar'
});
@gabrielgrant
gabrielgrant / controllers.application.js
Last active October 26, 2018 22:21
MVCE for emberjs/emberjs#15059
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@gabrielgrant
gabrielgrant / adapters.application.js
Last active March 26, 2022 20:54
Firebase hasMany
import FirebaseAdapter from 'emberfire/adapters/firebase';
export default FirebaseAdapter.extend({
});
@gabrielgrant
gabrielgrant / README.md
Last active November 24, 2015 17:57
Estimated Calorie Needs per Day by Age, Gender, and Physical Activity Level.

Estimated Calorie Needs per Day by Age, Gender, and Physical Activity Level

Based on USDA guidelines: http://www.cnpp.usda.gov/sites/default/files/usda_food_patterns/EstimatedCalorieNeedsPerDayTable.pdf

Estimated amounts of caloriesa needed to maintain calorie balance for various gender and age groups at three different levels of physical activity. The estimates are rounded to the nearest 200 calories for assignment to a USDA Food Pattern. An individual’s calorie needs may be higher or lower than these average estimates.

import requests
zips = "59221, 73949, 86515, 42223, 86044, 84536, 97635, 02861, 71749, 81137, 63673, 88063, 89439".split(', ')
url = 'https://congress.api.sunlightfoundation.com/districts/locate?apikey=4356d7e2b68340a69fb9b5e156e9cd49&zip='
for z in zips:
r = requests.get(url + z).json()['results']
print z, r