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
{ | |
"editor.fontFamily": "Operator Mono, Menlo, Monaco, 'Courier New', monospace", | |
"editor.fontSize": 13, | |
"window.zoomLevel": 0, | |
"editor.tabSize": 2, | |
"editor.fontLigatures": true, | |
"workbench.colorTheme": "Default Light+", | |
"editor.cursorBlinking": "solid", | |
"editor.minimap.enabled": false, | |
"editor.tokenColorCustomizations": { |
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 { execSync } = require('child_process') | |
const SENTRY_URL = 'https://app.getsentry.com/api/0/projects/radweb/inventorybase-go/releases' | |
const SENTRY_API_KEY = process.env.SENTRY_API_KEY | |
const VERSION = process.env.CIRCLE_SHA1 | |
function createSentryRelease() { | |
execSync(`curl ${SENTRY_URL} -u ${SENTRY_API_KEY} -X POST -d '${JSON.stringify({ version: VERSION })}' -H 'Content-Type: application-json'`) | |
} | |
function uploadToSentry(file, filename) { |
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
// would've been awesome if `speechSynthesis.speak` returned a promise which resolves on finish.. :( | |
const sleep = ms => new Promise(r => setTimeout(r, ms)) | |
async function go(msg) { | |
for (let v of speechSynthesis.getVoices()) { | |
speechSynthesis.speak(u = new SpeechSynthesisUtterance(msg), u.voice = v, u) | |
await sleep(1000) | |
} | |
} |
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
// https://twitter.com/ReactJSTraining/status/743567989434286080 | |
// https://codepen.io/ReactJSTraining/pen/MeePdW?editors=0010 | |
const { render, findDOMNode } = ReactDOM | |
//////////////////////////////////////////////////////////// | |
// Only code you need to change is inside this component | |
class PinToBottom extends React.Component { | |
static propTypes = { |
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
# starting with a Ubuntu 14 box on AWS | |
# increase swap | |
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04 | |
sudo fallocate -l 4G /swapfile | |
ls -lh /swapfile | |
sudo chmod 600 /swapfile | |
ls -lh /swapfile | |
sudo mkswap /swapfile |
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 type Options = { | |
blockSelector: () => string, | |
linkSelector: (id: string) => string, | |
classToToggle?: () => string, | |
toggleClass?: (el: Element, isInView: boolean, classToToggle: string) => void, | |
} |
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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="main"></div> |
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
Raven.config(dsn, { | |
dataCallback(data) { | |
const normalize = filename => filename.split('/www/', 2)[1] | |
data.exception.values[0].stacktrace.frames.forEach(frame => { | |
frame.filename = normalize(frame.filename) | |
}) | |
data.culprit = data.exception.values[0].stacktrace.frames[0].filename |
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
on run {input, parameters} | |
tell application "System Events" | |
set activeApp to name of first process whose frontmost is true | |
end tell | |
set _timestamp to (input as string) | |
tell application activeApp | |
set realDate to ((do shell script "date -r " & _timestamp) as string) |
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
// decorate the class, composition | |
function waitFor(prop) { | |
return ChildComponent => class extends Component { | |
render() { | |
return this.props[prop] ? <ChildComponent {...this.props} /> : null | |
} | |
} | |
} | |
// decorate the class, inheritance |
NewerOlder