const type = a => (
a === null ? 'null'
: a === undefined ? 'undefined'
: Object.prototype.toString.call(a).slice(8, -1))
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
multiple () { | |
local l x y p c | |
c=0 p=0 l=() | |
while :; do | |
case $1 in | |
-p) | |
if [[ $2 = -* ]]; then | |
echo '-p requires an argument' | |
return | |
fi |
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
/* eslint-disable no-console,import/no-dynamic-require,global-require */ | |
const path = require('path') | |
const gulp = require('gulp') | |
const R = require('ramda') | |
const watch = require('gulp-watch') | |
const webpack = require('webpack') | |
const { terminal } = require('terminal-kit') | |
const { ProgressPlugin } = webpack | |
const webpackPath = './webpack.config.js' |
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 search = curry((pattern, str) => $( | |
pattern, | |
match(/!?(".*?"|\S+)/g), | |
reject(test(/^\W*$/)), | |
map(replace(/"(.*)"/, '$1')), | |
partition(startsWith('!')), | |
over(lensIndex(0), ifElse(isEmpty, T, $(drop(1), map(includesI), complement(anyPass)))), | |
over(lensIndex(1), $(map(includesI), allPass)), | |
([n, p]) => and(n, p, str), | |
)) |
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
-- Standard awesome library | |
gears = require('gears') | |
awful = require('awful') | |
require('awful.autofocus') | |
-- Widget and layout library | |
wibox = require('wibox') | |
-- Theme handling library | |
beautiful = require('beautiful') | |
-- Notification library | |
naughty = require('naughty') |
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 net = require('net') | |
const { Observable } = require('rxjs') | |
const R = require('ramda') | |
const { | |
T, | |
concat, | |
cond, | |
drop, | |
equals, |
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 { spawn } = require('child_process') | |
const readToEnd = stream => | |
new Promise(((resolve, reject) => { | |
const parts = [] | |
stream.on('error', reject) | |
stream.on('data', part => parts.push(part)) | |
stream.on('end', () => resolve(Buffer.concat(parts))) | |
})) |
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 node | |
const { spawn } = require('child_process') | |
const { Observable } = require('rxjs') | |
const { | |
curry, | |
head, | |
identity, | |
join, | |
map, | |
memoize, |
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
git log --graph --oneline --decorate --all --color=always | | |
fzf --ansi +s --preview='git show --color=always {2}' \ | |
--bind='pgdn:preview-page-down' \ | |
--bind='pgup:preview-page-up' \ | |
--bind='enter:execute:git show --color=always {2} | less -R' \ | |
--bind='ctrl-x:execute:git checkout {2} .' |