Skip to content

Instantly share code, notes, and snippets.

Working from home

Richard van der Dys dijs

Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am dijs on github.
  • I am dijs ( on keybase.
  • I have a public key ASAwfYz8pR__vxK7rmaK-yFUWJFuB11izKq98hOv6ZDjJwo

To claim this, I am signing this object:

dijs / get.js
Created Apr 16, 2017
Get implementation
View get.js
function get(obj, path, def) {
const parts = path.split('.');
const [first,] = parts;
const value = obj[first];
if (parts.length === 1) {
return value || def;
return get(value, parts.slice(1).join('.'), def);
View Conditional

Conditional Chains

This Gist was automatically created by Carbide, a free online programming environme

dijs / jsdom-iframe-test.js
Created Jul 20, 2016
Example of testing iframe messaging using jsdom
View jsdom-iframe-test.js
import { expect } from 'chai';
import jsdom from 'jsdom';
describe('JSDOM', () => {
it('should communicate with inner iframes', done => {
url: "",
done (err, window) {
var frame = window.document.createElement('iframe');
dijs /
Created Jan 4, 2016
React Containers and Components

Redux is done a bit differently...


  • Fetch data
  • Manage data
  • Show fetching errors, loading, and UI
  • Compose these

Components (Dumb)

  • Only use props for data
dijs / gist:4f93be50064c9f326c3c
Created Nov 30, 2015
Link Grammar Make Error
View gist:4f93be50064c9f326c3c
Undefined symbols for architecture x86_64:
"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
std::__1::vector<int, std::__1::allocator<int> >::__append(unsigned long) in libsat-solver.a(sat-encoder.o)
void std::__1::vector<PositionConnector*, std::__1::allocator<PositionConnector*> >::__push_back_slow_path<PositionConnector* const>(PositionConnector* const&) in libsat-solver.a(sat-encoder.o)
void std::__1::vector<std::__1::pair<PositionConnector const*, PositionConnector const*>, std::__1::allocator<std::__1::pair<PositionConnector const*, PositionConnector const*> > >::__push_back_slow_path<std::__1::pair<PositionConnector const*, PositionConnector const*> const>(std::__1::pair<PositionConnector const*, PositionConnector const*> const&) in libsat-solver.a(sat-encoder.o)
void std::__1::vector<WordTag, std::__1::allocator<WordTag> >::__push_back_slow_path<WordTag const>(WordTag const&) in libsat-solver.a(sat-encoder.o)
dijs / gist:2ae366f4948177b3fdb6
Created Nov 30, 2015
Link Grammar configure output
View gist:2ae366f4948177b3fdb6
link-grammar-5.3.1 build configuration settings
prefix: /usr/local
C compiler: gcc -DUSE_SAT_SOLVER=1 -DHAVE_SQLITE=1 -g -O2 -O3 -std=c99 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -D_DEFAULT_SOURCE -arch x86_64
C++ compiler: g++ -DUSE_SAT_SOLVER=1 -DHAVE_SQLITE=1 -g -O2 -O3 -Wall -std=c++03
autopackage relocatable binary: no
Posix threads: no
Editline command-line history: no
UTF8 editline support: no
Java libraries: no
dijs / bond.js
Created Nov 16, 2015
Spying on James Bond
View bond.js
import 'babel-polyfill'
import Wiki from './dist/wiki'
import Knwl from 'knwl.js'
let knwlInstance = new Knwl('english')
knwlInstance.register('dates', require('./node_modules/knwl.js/default_plugins/places'));
let wiki = new Wiki({
uri: ''
dijs /
Last active Nov 19, 2015
Continuous Improvement: Development with ES(6-7), React and Redux

Continuous Improvement: Development with ES(6-7) / React / Redux


  • Adopt on the technology radar from Thoughtworks
  • More functional, easier to follow techniques (async/await)
  • No more waiting for new code features with
  • New techniques promote better predictability and reusable code
  • Demo
  • All features
dijs /
Created Oct 27, 2015
Async/await do for each ideas

ES7's async/await is awesome!

But, in order to use it well, you need to think in promises.

First thought:

async function something() => {
  let state = []
 await [1, 2, 3].forEach(async(n) =&gt; {