I hereby claim:
- I am caub on github.
- I am caub (https://keybase.io/caub) on keybase.
- I have a public key whose fingerprint is 252A 77AD 73A4 A8BC FF76 D655 303C 5F10 6F57 4D9B
To claim this, I am signing this object:
| const { Readable } = require('stream'); | |
| const ys = Buffer.from('y\n'.repeat(2**16)); | |
| class Y extends Readable { | |
| _read(size) { | |
| this.push(ys.slice(0, size)); | |
| } | |
| } | |
| new Y().pipe(process.stdout); // test with node yes | pv -r > /dev/null |
| [user] | |
| email = cyril.auburtin@gmail.com | |
| name = caub | |
| [alias] | |
| a = add --all | |
| au = add -u | |
| b = branch | |
| br = branch -r | |
| amend = commit --amend -C HEAD |
| // render .js files as templates (they must be function taking options as arguments and outputting a valid HTML string) | |
| app.engine('js', function (filePath, options, callback) { | |
| if (process.env.NODE_ENV !== 'production') { | |
| require.cache[filePath] = undefined; // invalidate require cache in dev | |
| } | |
| callback(null, require(filePath)(options)); // note: should wrap in a safeHtml in prod | |
| }); | |
| app.set('views', __dirname + '/views'); | |
| app.set('view engine', 'js'); |
| const { Store } = require('express-session'); | |
| const { knex } = require('.'); | |
| class PGStore extends Store { | |
| destroy(sid, cb) { | |
| return knex('sessions').where('id', sid).delete().then(() => cb()); | |
| } | |
| get(sid, cb) { | |
| // console.log('get', sid); |
| diff --git a/bin/cli.js b/bin/cli.js | |
| index 9dc79f9..cf68699 100755 | |
| --- a/bin/cli.js | |
| +++ b/bin/cli.js | |
| @@ -33,11 +33,23 @@ function checkLocalModule(env) { | |
| } | |
| function initKnex(env) { | |
| - | |
| checkLocalModule(env); |
I hereby claim:
To claim this, I am signing this object:
| // https://codesandbox.io/s/jznpj65nm5 | |
| // ------- index.js | |
| import React from 'react'; | |
| import { render } from 'react-dom'; | |
| import Hello from './Hello'; | |
| import DataProvider from './DataProvider'; | |
| import * as data from './dataStore'; | |
| const styles = { |
| create table foo ( | |
| id bigserial primary key, | |
| name text, | |
| created date | |
| ); | |
| insert into foo(name,created) values | |
| ('lol', '2018-01-09'), | |
| ('lol', '2018-01-08'), | |
| ('lol', '2018-01-08'), |
| /** | |
| This middleware enhances redux-thunk, to deal with asynchronous actions | |
| conventions and usage: | |
| - an action is a plain object `{type: TYPE_CONSTANT, value: ANY_VALUE}` or an array of those actions (handled by reducer) | |
| - you can shape action creators as `queryArgs => promise` (where the promise returns an action) | |
| - or `queryArgs => action` (where the action value is a promise). | |
| examples: | |
| const getProfile = id => ({ type: GET_PROFILE, value: fetchApi(`/profile/${id}`) }); |
| create table foo ( | |
| id bigserial primary key, | |
| prev bigint | |
| ); | |
| insert into foo(id, prev) values | |
| (1, NULL), | |
| (2, 1), | |
| (4, 2), | |
| (12, 4), |