mkdir icons.iconset
sips -z 16 16 icon1024.png --out icons.iconset/icon_16x16.png
sips -z 32 32 icon1024.png --out icons.iconset/[email protected]
sips -z 32 32 icon1024.png --out icons.iconset/icon_32x32.png
sips -z 64 64 icon1024.png --out icons.iconset/[email protected]
sips -z 128 128 icon1024.png --out icons.iconset/icon_128x128.png
sips -z 256 256 icon1024.png --out icons.iconset/[email protected]
sips -z 256 256 icon1024.png --out icons.iconset/icon_256x256.png
sips -z 512 512 icon1024.png --out icons.iconset/[email protected]
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* fibonacci() { | |
let x = 0 | |
let y = 1 | |
yield x | |
yield y | |
while (true) yield x < y ? x = x + y : y = x + y | |
} |
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 cache = new Map() | |
service.get = uri => { | |
if (!cache.has(uri)) { | |
cache.set(uri, fetch(uri)) | |
} | |
return cache.get(uri) | |
} |
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
{ | |
"babel": { | |
"plugins": [ | |
"transform-es2015-modules-commonjs", | |
"syntax-async-functions", | |
"transform-async-to-generator" | |
] | |
}, | |
"devDependencies": { | |
"babel-plugin-transform-es2015-modules-commonjs": "6.8.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 test from 'tape'; | |
test('What component aspect are you testing?', assert => { | |
const actual = 'What is the actual output?'; | |
const expected = 'What is the expected output?'; | |
assert.equal(actual, expected, 'What should the feature do?'); | |
assert.end(); | |
}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://unpkg.com/redux@^3.5.2/dist/redux.min.js"></script> | |
<script src="https://unpkg.com/@reactivex/[email protected]/dist/global/Rx.js"></script> | |
<script src="https://unpkg.com/redux-observable/dist/redux-observable.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
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
interface FluxStandardAction { | |
type: string | symbol | any; | |
payload?: any; | |
error?: boolean | any; | |
meta?: any | |
} |
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 parseAuthorizationBearer = req => { | |
if (!req.headers.authorization) return | |
const headerParts = req.headers.authorization.split(' ') | |
if (headerParts[0].toLowerCase() === 'bearer') return headerParts[1] | |
} |
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
// `jwt` is the encoded JSON Web Token | |
// `token` is the decoded jwt | |
// jwtFromRequest(req: Request): String | |
// algorithmFromToken(token: Object): String | |
// keyFromToken(token: Object): Promise<key: string> | |
const auth = fucntion({ jwtFromRequest, keyFromToken, algorithmFromToken }) { | |
return (req, res, next) => { | |
const jwt = jwtFromRequest(req) |
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 output(a, b, format = 'text') { | |
const dispatchTable = { | |
"text": textOutput, | |
"html": htmlOutput | |
} | |
if (dispatchTable[format] === undefined) { | |
throw new Error(`unknown format ${format}`) | |
} | |
OlderNewer