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
const alfy = require("alfy"); | |
const alfyFetchOptions = { | |
auth: auth, | |
maxAge: requestCacheInMilis | |
}; | |
const auth = "username:password"; | |
const requestCacheInMilis = 1000 * 60 * 60 * 24; //24 hours |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es5", | |
"sourceMap": false, | |
"inlineSourceMap": true, | |
"module": "esnext", | |
"moduleResolution": "node", | |
"jsx": "react", | |
"preserveConstEnums": true, | |
"removeComments": false, |
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
mode: "production", | |
entry: { | |
app: path.join(__dirname, "index.tsx"), | |
}, | |
output: { | |
path: path.resolve(__dirname, "public/dist"), | |
publicPath: "", | |
chunkFilename: "[name].js", | |
filename: "[name].js" | |
}, |
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 { reducer as formReducer } from "redux-form"; | |
const applicationReducer: Reducer<any> = combineReducers({ | |
user, | |
sidenav, | |
navigation, | |
//... | |
form: formReducer | |
}); |
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 function injectAsyncReducer(store, name, asyncReducer) { | |
if (store.asyncReducers[name]) { | |
return; | |
} | |
store.asyncReducers[name] = asyncReducer; | |
store.replaceReducer(createReducer(store.asyncReducers)); | |
} | |
export const configureStore = (initialState: AppState) => { | |
const enhancer = compose(applyMiddleware(...getMiddleware())); |
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
def fib(n: Int): Int = { | |
@annotation.tailrec | |
def loop(n: Int, prev: Int, cur: Int): Int = | |
if (n == 0) prev | |
else loop(n - 1, cur, prev + cur) | |
loop(n, 0, 1) | |
} | |
fib(6) |
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
//Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. | |
//https://leetcode.com/explore/interview/card/facebook/5/round-1-phone-interview/289/ | |
//Solution 1 - Not efficient o(n^2) | |
//--------------------------------------------------- | |
var validPalindrome = function(s) { | |
for (let i = 0; i < s.length; i++) { | |
let w = s.substr(0, i) + s.substr(i + 1); | |
if (isPal(w)) { | |
return true; |
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
license: mit |
OlderNewer