Skip to content

Instantly share code, notes, and snippets.

View jdx's full-sized avatar

jdx

View GitHub Profile
@jdx
jdx / gulpfile.js
Last active August 11, 2016 23:49
Simple React gulpfile.js
'use strict'
const fs = require('fs')
const gulp = require('gulp')
const path = require('path')
fs.readdirSync(path.join(__dirname, 'gulp'))
.filter(f => f.endsWith('.js'))
.forEach(module => require('./gulp/' + module))
@jdx
jdx / app.jsx
Created August 11, 2016 23:19
Simple React super basic react jsx
const React = require('react')
const ReactDOM = require('react-dom')
class App extends React.Component {
render () {
return <div>
<h1>Hello world!</h1>
</div>
}
}
@jdx
jdx / index.html
Created August 11, 2016 23:13
Simple React index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Simple React</title>
</head>
<body>
<div id="app"></div>
<script src="/app.js"></script>
</body>
@jdx
jdx / server.js
Last active August 11, 2016 23:06
Simple React Basic Fileserver
'use strict'
const koa = require('koa')
const send = require('koa-send')
const path = require('path')
const app = koa()
app.use(require('koa-compress')())
app.use(require('koa-logger')())
app.use(require('koa-static')('public'))
'use strict'
const fs = require('fs-extra')
const path = require('path')
const os = require('os')
class Config {
constructor () {
this._path = path.join(os.homedir(), '.config', 'heroku', 'config.json')
this._read()
@jdx
jdx / words
Last active July 12, 2016 15:08
love - like
much - many
child - kid
large - big
deal - sale
companion - partner
trash - junk
above - over
specify - designate
capitulate: cease to resist an opponent or an unwelcome demand; surrender: the patriots had to capitulate to the enemy forces.

It's just as if a man were wounded with an arrow thickly smeared with poison. His friends & companions, kinsmen & relatives would provide him with a surgeon, and the man would say, 'I won't have this arrow removed until I know whether the man who wounded me was a noble warrior, a priest, a merchant, or a worker.' He would say, 'I won't have this arrow removed until I know the given name & clan name of the man who wounded me... until I know whether he was tall, medium, or short... until I know whether he was dark, ruddy-brown, or golden-colored... until I know his home village, town, or city... until I know whether the bow with which I was wounded was a long bow or a crossbow... until I know whether the bowstring with which I was wounded was fiber, bamboo threads, sinew, hemp, or bark... until I know whether the shaft with which I was wounded was wild or cultivated... until I know whether the feathers of the shaft with which I was wounded were those of a vulture, a stork, a hawk, a peacock, or another bird...

# current way
$ heroku cerate my-new-app-name --region us
! `cerate` is not a heroku command.
! Perhaps you meant `create`.
! See `heroku help` for a list of available commands.
$ heroku create # user has to copy-paste, or re-type
# new way
$ heroku cerate my-new-app-name --region us
▸ cerate is not a heroku command.
@jdx
jdx / wait.js
Last active April 27, 2016 21:06
let wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
@jdx
jdx / run.js
Created April 20, 2016 18:19
node spawn example
'use strict';
let spawn = require('child_process').spawn;
spawn('git', ['--version'], {stdio: 'inherit'});