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
let | |
p = s => process.stdout.write(s), | |
esc = (...x) => x.map(i => p('\u001B[' + i)), | |
{columns, rows} = process.stdout, | |
[w, h] = [columns, rows * 2], | |
i = w * h, | |
s = Array(w * h).fill(false), | |
cx = Math.floor(w / 2) - 6, cy = Math.floor(h / 2) - 7, | |
seed = Date.now() % 3 |
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
global.table = (json) => { | |
let Table = require('cli-table3') | |
let table = new Table({head: Object.keys(json[0])}); | |
table.push(...json.map(Object.values)) | |
return table.toString() | |
} |
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
// 1. load https://www.linkedin.com/mynetwork/ | |
// 2. make sure your LinkedIn is in English | |
// 3. paste this script on chrome dev tools at your own risk | |
async function moreConnectionsPlease() { | |
// maximum limit of Connect buttons clicked | |
const LIMIT = 500; | |
// wait in ms before each scroll | |
const SCROLL_TIMEOUT = 600; | |
// bulk scroll will scroll this amount of times |
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
# Brew | |
export PATH="/usr/local/sbin:$PATH" | |
# Php | |
export PATH="/usr/local/opt/[email protected]/bin:$PATH" | |
export PATH="$PATH:~/.composer/vendor/bin" | |
export dep="/Users/anton/Projects/deployer/bin/dep" | |
#export COMPOSER_DISABLE_XDEBUG_WARN=1 | |
eval "$(symfony-autocomplete)" |
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
global.find = re => json => [...find(json, re)] | |
function* find(v, regex, path = '') { | |
if (regex.test(path)) { | |
yield path | |
return | |
} | |
if (typeof v === 'undefined' || v === null) { | |
return |
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 bash | |
fd frame | while read line; do | |
convert $line \ | |
\( +clone -alpha extract \ | |
-draw 'fill black polygon 0,0 0,15 15,0 fill white circle 15,15 15,0' \ | |
\( +clone -flip \) -compose Multiply -composite \ | |
\( +clone -flop \) -compose Multiply -composite \ | |
\) -alpha off -compose CopyOpacity -composite $line; | |
done |
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
package expr_test | |
import ( | |
"testing" | |
"github.com/antonmedv/expr" | |
"github.com/dop251/goja" | |
"github.com/robertkrimen/otto" | |
) |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"regexp" | |
"strings" | |
) | |
type token = string |
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
/** | |
* Fast extract part of json by path. | |
* Example: fastJSON('{...}', ['foo', 'bar']) | |
* | |
* @param {String} input JSON string | |
* @param {Array} path Path for extraction | |
* @returns {String} Extracted JSON string | |
* @throws SyntaxError | |
*/ | |
function fastJSON(input, path) { |
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
<?php declare(strict_types=1); | |
$app->get('/prices', [ | |
ParseParams::class, | |
NormalizeParams::class, | |
delayed() => Notify::class, | |
parallel() => [ | |
ServiceA::class, | |
SomeOtherService::class, | |
ServiceB::class, |
NewerOlder