This file contains hidden or 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 loaded_matchparen=1 | |
set number numberwidth=5 | |
set tabstop=2 softtabstop=2 expandtab shiftwidth=2 smarttab | |
set list | |
set listchars=tab:▸\ ,trail:·,nbsp:⎵ | |
set background=dark |
This file contains hidden or 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
antelope eats grass | |
big-fish eats little-fish | |
bug eats leaves | |
bear eats big-fish | |
bear eats bug | |
bear eats chicken | |
bear eats cow | |
bear eats leaves | |
bear eats sheep | |
chicken eats bug |
This file contains hidden or 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
#include <stdio.h> | |
#define hash(c) 1 << (c - 'a') | |
int numSplits(char * s) { | |
unsigned int n = 0, l = 0, r = 0, i = 0, j = 0, cur = 0; | |
while (s[i]) { | |
r |= hash(s[i++]); | |
} |
This file contains hidden or 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
// http://www.cse.yorku.ca/~oz/hash.html | |
const hash = str => { | |
let h = 0 | |
for (let i = 0; i < str.length; ++i) { | |
h = (33 * h) ^ str.charCodeAt(i) // seems no one knows why 33 | |
} | |
return h | |
} | |
const HackMap = () => { |
This file contains hidden or 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 issues = $('.ghx-issues')[0] | |
var getData = (issues, selectors) => { | |
return selectors.map(([sel, name, getter]) => { | |
return Array.from(issues.querySelectorAll(sel)).map(item => ({ | |
[name]: getter ? item[getter] : item.innerText | |
})) | |
}).reduce((items, next) => items.map((item, j) => ({...item, ...next[j]}))) | |
} | |
var result = getData(issues, [['.ghx-summary', 'title'], ['.ghx-key', 'ticket'], ['.ghx-type', 'type', 'title']]) |
This file contains hidden or 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
{ | |
"breadcrumbs.enabled": false, | |
"city-lights-icons-vsc.hidesExplorerArrows": true, | |
"files.autoSave": "afterDelay", | |
"files.autoSaveDelay": 5000, | |
"editor.acceptSuggestionOnCommitCharacter": false, | |
"editor.autoClosingBrackets": "never", | |
"editor.autoClosingOvertype": "never", | |
"editor.autoIndent": "keep", | |
"editor.autoSurround": "never", |
This file contains hidden or 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
# Certs https://stackoverflow.com/a/55249339/958007 | |
function setup-certs() { | |
local cert_path="$HOME/.certs/all.pem" | |
local cert_dir=$(dirname "${cert_path}") | |
[[ -d "${cert_dir}" ]] || mkdir -p "${cert_dir}" | |
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain > "${cert_path}" | |
security find-certificate -a -p /Library/Keychains/System.keychain >> "${cert_path}" | |
export GIT_SSL_CAINFO="${cert_path}" | |
export AWS_CA_BUNDLE="${cert_path}" | |
export NODE_EXTRA_CA_CERTS="${cert_path}" |
This file contains hidden or 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
/* | |
partout([ | |
'artifact', | |
{ name: 'output', defaultValue: '.' }, | |
{ name: 'platform', flag: true, parse: true } | |
], '-p darwin app'.split(' ')) | |
*/ | |
const identity = (value) => value; |
This file contains hidden or 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 | |
command -v ipt &>/dev/null || npm i -g ipt | |
git fetch origin | |
name=$(git branch -r --sort=-committerdate | grep '^\s*origin/' | grep -v 'HEAD' | sed 's/^[[:space:]]*origin\///' | ipt -a -S 20) | |
if [[ -z "$name" ]]; then | |
exit 1 | |
fi |
This file contains hidden or 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 fs = require('fs') | |
var path = require('path') | |
var cwd = typeof __dirname === 'undefined' ? process.cwd() : __dirname | |
var repos = fs.readdirSync('./packages').map(path => cwd+'/packages/'+path).filter(path => fs.lstatSync(path).isDirectory()).concat([cwd]) | |
var getParent = (p, n = 1) => p.split(path.sep).slice(0, -n).join(path.sep) | |
var allDeps = repos | |
.map(repo => repo+'/package.json') | |
.filter(p => fs.existsSync(p)) | |
.map(package => Object.keys(require(package).dependencies).map(dep => { | |
delete require.cache[dep] |
NewerOlder