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
const request = require('request'); | |
const OPEN_EXCHANGE_API_URL = 'https://openexchangerates.org/api'; | |
const OE_LATEST = `${OPEN_EXCHANGE_API_URL}/latest.json`; | |
module.exports = function(ctx, done) { | |
const APP_ID = ctx.data.APP_ID; | |
const url = `${OE_LATEST}?app_id=${APP_ID}`; |
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
export default function createReducer(initialState, handlers) { | |
return function reducer(state = initialState, action) { | |
let nextState = state; | |
if ({}.hasOwnProperty.call(handlers, '*')) { | |
nextState = handlers['*'](nextState, action); | |
} | |
if ({}.hasOwnProperty.call(handlers, action.type)) { | |
return handlers[action.type](nextState, action); |
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
--accept_const_keyword : Allows usage of const keyword. | |
--angular_pass : Generate $inject properties for | |
AngularJS for functions annotated | |
with @ngInject | |
--charset VAL : Input and output charset for all | |
files. By default, we accept UTF-8 as | |
input and output US_ASCII | |
--closure_entry_point VAL : Entry points to the program. Must be | |
goog.provide'd symbols. Any goog.provi | |
de'd symbols that are not a transitive |
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
<!-- In your template --> | |
<div data-gist="{{gistId}}"></div> |
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 bitRev(N) { | |
var r = 0; | |
val = 0; | |
while(N > 0) { | |
val = N&1; | |
N >>= 1; | |
r += val&1; | |
r <<= 1; |
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 http = require('http'), | |
https = require('https'), | |
fs = require('fs'), | |
url = require('url'); | |
/* | |
var options = { | |
key: fs.readFileSync('ssl/server.key'), | |
cert: fs.readFileSync('ssl/server.crt') | |
}; | |
*/ |