const compose = (...fns) =>
fns.reduceRight((prevFn, nextFn) =>
(...args) => nextFn(prevFn(...args)),
value => value
);
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
! *----------------------------* | |
! | Dotfiles - .Xresources | | |
! *----------------------------* | |
! This files contains configuration for: | |
! * terminal colours | |
! * urxvt | |
! * rofi |
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
var spawn = require('child_process').spawn; | |
var pass = require('stream').PassThrough; | |
var a = spawn('echo', ['hi user']); | |
var b = new pass; | |
var c = new pass; | |
a.stdout.pipe(b); | |
a.stdout.pipe(c); |
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
<script src="https://unpkg.com/@webcomponents/custom-elements"></script> | |
<style> | |
body { | |
margin: 0; | |
} | |
/* Style the element from the outside */ | |
/* | |
fancy-tabs { | |
margin-bottom: 32px; |
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
upstream ws_server { | |
server 127.0.0.1:8080; | |
} | |
server { | |
listen 80; | |
server_name 10.1.2.225; | |
location / { | |
proxy_pass http://ws_server/; |
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
#!/usr/bin/env sh | |
set -euv | |
# Updated on April 2019 to reflect changes in GN | |
# See: | |
# https://github.com/ninja-build/ninja | |
# https://gn.googlesource.com/gn/ | |
# We need a recent git |
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
'use strict'; | |
var clarinet = require('clarinet'); | |
/** | |
* Extract a detailed JSON parse error | |
* using https://github.com/dscape/clarinet | |
* | |
* @param {string} json | |
* @returns {{snippet:string, message:string, line:number, column:number, position:number}} or undefined if no error | |
*/ |
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
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git |
Functional programming gets a bad wrap about being too hard for mere mortals to comprehend. This is nonsense. The concepts are actually quite simple to grasp.
The jargon is the hardest part. A lot of that vocabulary comes from a specialized field of mathematical study called category theory (with a liberal sprinkling of type theory and abstract algebra). This sounds a lot scarier than it is. You can do this!
All examples using ES6 syntax. wrap (foo) => bar
means:
function wrap (foo) {