Skip to content

Instantly share code, notes, and snippets.

import { expect } from "chai";
function buildCombinations(start: string, pieces: string[]): string[] {
if (pieces.length < 1) {
return [start];
}
const allCombinations: string[][] = pieces.map((newStart) => {
let remaining = [...pieces];
remaining.splice(remaining.indexOf(newStart), 1);
import { expect } from "chai";
function dig(obj: any, key: string): any {
return key.split(".").reduce((memo, keyPiece) => {
if (!Object.keys(memo).includes(keyPiece)) {
throw new Error("key not found");
}
return memo[keyPiece];
}, obj);
}
@wusher
wusher / .zshrc
Created April 20, 2017 14:00 — forked from bmhatfield/.zshrc
OSX Keychain Environment Variables
# If you use bash, this technique isn't really zsh specific. Adapt as needed.
source ~/keychain-environment-variables.sh
# AWS configuration example, after doing:
# $ set-keychain-environment-variable AWS_ACCESS_KEY_ID
# provide: "AKIAYOURACCESSKEY"
# $ set-keychain-environment-variable AWS_SECRET_ACCESS_KEY
# provide: "j1/yoursupersecret/password"
export AWS_ACCESS_KEY_ID=$(keychain-environment-variable AWS_ACCESS_KEY_ID);
export AWS_SECRET_ACCESS_KEY=$(keychain-environment-variable AWS_SECRET_ACCESS_KEY);
#!/bin/bash
for FILEPATH in $(git diff --name-status | grep -v "^D" | awk '{ print $2; }' | uniq )
do
grep -rn "<<<<*" $FILEPATH
grep -rn "====*" $FILEPATH
grep -rn ">>>>*" $FILEPATH
done