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
| var printf = function{}; //printf | |
| var url //arguments to array | |
| var literalHash = {}; | |
| function parseLiteral(literal) { | |
| var args = utl.toArray(arguments); | |
| if (/^@/.test(args[0])) { | |
| args[0] = args[0].substr(1); | |
| return buildString.apply(this, args); | |
| } |
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
| var Request = require('request'); | |
| app.get('/forceDownloadFile', function(req, res){ | |
| Request | |
| .get('https://goo.gl/3IYOGV') // url to another service (for example: amazon); | |
| .on('response', function(fileRes){ | |
| res.setHeader('Content-disposition', 'attachment; filename=helloWorld.pdf'); | |
| res.setHeader('Content-type', resp.headers['content-type']); | |
| fileRes.pipe(res); | |
| }); |
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
| (function(proxied) { | |
| (function(open) { | |
| XMLHttpRequest.prototype.open = function(method, url, async, user, pass) { | |
| // if (/issues/.test(url)) { | |
| console.log(this.onreadystatechange); | |
| this.addEventListener("readystatechange", function() { | |
| console.log('readystate: ' + this.readyState); | |
| if (this.responseText !== '') { | |
| this.responseText = '[{"url":"222"}]'; | |
| } |
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
| import Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle' | |
| }); |
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
| import * as types from '../actions/types'; | |
| export const addTodo = text => dispatch => dispatch({type: types.ADD_TODO, text}); | |
| export const deleteTodo = id => dispatch => dispatch({type: types.DELETE_TODO, id}); | |
| export const editTodo = (id, text) => dispatch => dispatch({type: types.EDIT_TODO, id, text}); | |
| export const completeTodo = id => dispatch => dispatch({type: types.COMPLETE_TODO, id}); | |
| export const clearCompleted = () => dispatch => dispatch({type: types.CLEAR_COMPLETED}); | |
| export const showAll = () => dispatch => dispatch({type: types.SHOW_ALL}); | |
| export const showActive = () => dispatch => dispatch({type: types.SHOW_ACTIVE}); | |
| export const showCompleted = () => dispatch => dispatch({type: types.SHOW_COMPLETED}); |
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
| import Ember from 'ember'; | |
| export default Ember.Component.extend({ | |
| }); |
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
| import Ember from 'ember'; | |
| export default Ember.Component.extend({ | |
| }); |
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
| import Service from '@ember/service'; | |
| import { computed } from '@ember/object'; | |
| import { inject } from '@ember/service'; | |
| console.log(Ember.Service); | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| myZero: inject(), | |
| myOne: inject(), | |
| myTwo: inject(), |
OlderNewer