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
#!/bin/sh | |
# tbe source directory | |
# i.e. dev -- //sta-vs-wfmedia1/media/tbe/ | |
SRC_DIR="$HOME/projects/Wordfly/Website/tms/nodeapp/test/file-fixtures/tbe" | |
# tbe destination parent directory | |
# i.e. staging/prod -- NEED PATH | |
DEST_DIR="$HOME/tmp" | |
echo "Copying tbe directory into destination" |
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
// using stringify | |
// import foo from './foo.html' | |
// using brfs: | |
// var foo = require('fs').readFileSync('foo.html', 'utf8') | |
import fs from 'fs' | |
export default function read(path){ | |
return fs.readFileSync(path, 'utf8') | |
} |
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
find . -type f | sed 's/.*\.//' | sort | uniq -c |
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
#!/usr/bin/env node | |
/* | |
An OS-agnostic file/dir copy (cp). | |
// copy a single file to a new location | |
./cp.js foo/existing.txt foo/newname.txt | |
// copy contents of a directory into another | |
./cp.js foo/ bar/ | |
*/ |
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 { | |
'localhost': { | |
baseApiUrl: 'http://localhost:3001/api/' | |
}, | |
'mytestserver.com': { | |
baseApiUrl: 'http://mytestapi.com/' | |
}, | |
'myprod.com': { | |
baseApiUrl: 'http://myprod.api/' | |
} |
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
/** | |
* minimal configuration object. | |
*/ | |
import assign from 'object-assign' | |
// default configuration is based on the hostname. | |
const cfg = { | |
'localhost': { | |
// mocks | |
baseApiUrl: '//localhost:3001/api/' |
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 express = require('express'); | |
var app = express(); | |
if (global.Intl) { | |
// `Intl` exists, but it doesn't have the data we need, so load the | |
// polyfill and patch the constructors we need with the polyfill's. | |
var IntlPolyfill = require('intl'); | |
Intl.NumberFormat = IntlPolyfill.NumberFormat; | |
Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat; |
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
// global.Intl = require('intl'); | |
// global.Intl.__applyLocaleSensitivePrototypes(); | |
// Intl.NumberFormat = IntlPolyfill.NumberFormat; | |
// Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat; | |
// IntlPolyfill.__applyLocaleSensitivePrototypes(); | |
var IntlPolyfill = require('intl'); | |
Intl.NumberFormat = IntlPolyfill.NumberFormat; | |
Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat; |
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
#!/usr/bin/env node | |
'use strict'; | |
if (process.argv.length <= 2) { | |
process.stdout.write(`Usage: node ./emojize.js <outputPath>\n`); | |
process.exit(-1); | |
} | |
const path = require('path'); | |
const inPath = path.resolve(process.argv[2]); |
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
dispatch(action) (state, action) | |
+-------------+ data +------------+ +------------+ +--> +------------+ | |
| gql/bff api | +--> | Action | +--> | Store | | Reducers | | |
+------^------+ | Creators | +-----+------+ <--+ +------------+ | |
| +------------+ <-+ | (newState) | |
+--------+ fetch(url, query) | | | |
| connect | |
| | | |
| | | |
| +-----v------+ |