⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains 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
// --- Function #1 --- | |
// Create sum function which takes someArray as a parameter. | |
// In the function: | |
// -Declare a variable count = 0 | |
// -Iterate through someArray in a for loop, adding each | |
// number in someArray to count | |
// Return count. | |
var sum = function(someArray) { | |
var count = 0; |
This file contains 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
import Ember from 'ember'; | |
import ENV from "dependency-injection-demo/config/environment"; | |
export default Ember.Controller.extend({ | |
tag: null, | |
displayMessage: null, | |
searchResults: null, | |
appId: ENV.INSTAGRAM_CLIENT_ID, | |
count: 10, |
This file contains 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
import InstagramApiClient from 'dependency-injection-demo/adapters/instagram'; | |
import Ember from 'ember'; | |
export default { | |
name: 'register-stubbables', | |
initialize: function(container, app) { | |
if (!Ember.testing) { | |
app.register('instagram-api-client:main', InstagramApiClient); | |
} | |
app.inject('controller:index', 'instagramApiClient', 'instagram-api-client:main'); |
This file contains 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
import Ember from 'ember'; | |
import ENV from "dependency-injection-demo/config/environment"; | |
export default Ember.Object.extend({ | |
appId: ENV.INSTAGRAM_CLIENT_ID, | |
/* | |
* Makes a JSONP request to get recent media tagged with a particular hashtag. | |
* | |
* Supported keys for options: |
This file contains 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
tag: null, | |
displayMessage: null, | |
searchResults: null, | |
count: 10, | |
instagramApiClient: null, // injected |
This file contains 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
import Ember from 'ember'; | |
var FakeClientApi = Ember.Object.extend({ | |
recentMediaForTagStub: null, | |
stubRecentMediaForTag: function(callback){ | |
this.recentMediaForTagStub = callback; | |
}, | |
recentMediaForTag: function(tag, options) { | |
if (this.recentMediaForTagStub) { | |
var results = this.recentMediaForTagStub.call(this, tag, options); |
This file contains 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
import Ember from 'ember'; | |
import { test } from 'ember-qunit'; | |
import startApp from '../helpers/start-app'; | |
import {yoloInstagramRecentMediaJson} from './fixtures/instagram-json'; | |
var App; | |
module('Integration: Instagram Search', { | |
setup: function() { | |
App = startApp(); |
This file contains 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
export var yoloInstagramRecentMediaJson = {"pagination":{"next_max_tag_id":"1414697845333930","deprecation_warning":"next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead","next_max_id":"1414697845333930","next_min_id":"1414697900707568","min_tag_id":"1414697900707568","next_url":"https:\/\/api.instagram.com\/v1\/tags\/yolo\/media\/recent?count=16\u0026callback=jQuery1111011989749874919653_1414697864571\u0026client_id=c9be10c8dce447049b4f6939d2532caf\u0026max_tag_id=1414697845333930\u0026_=1414697864572"},"meta":{"code":200},"data":[{"attribution":null,"tags":["beautiful","life","old","bestie","yolo","school","days","laugh","love","times","miss","perfect","forever","lame","friends","make","up","amazing","live","wonderful","cutie","adorable"],"location":null,"comments":{"count":0,"data":[]},"filter":"Normal","created_time":"1414697900","link":"http:\/\/instagram.com\/p\/uyeWEJQ9SB\/","likes":{"count":0,"data":[]},"images":{"low_resolution":{"url":"http:\/\/scontent-b.cd |
OlderNewer