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
#!/bin/sh | |
# sets the AWS_PROFILE env var with a fzf choice | |
# make sure to prefix the script with a dot so it runs in your native shell, eg `. ./fzf-aws.sh` | |
# Read the AWS config file | |
config_file="$HOME/.aws/config" | |
# called out here to select a different grep, egrep, ripgrep, ag etc | |
grepBin=$(which grep) | |
# Use grep to get a list of profiles | |
profile_choices=$($grepBin -E "^\[profile|^\[default" "$config_file" | cut -d' ' -f2 | tr -d ']' | tr -d '[') |
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 python3 | |
import os | |
import sys | |
import glob | |
import subprocess | |
import shlex | |
import shutil | |
import pathlib | |
import itertools |
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 python | |
# coding=utf-8 | |
import json, os, sys, io, re | |
from pprint import pprint | |
with io.open('/Users/nick/Documents/dominiontabs/card_db/en_us/cards.json') as data_file: | |
cardDict = json.load(data_file) | |
with io.open('/Users/nick/Documents/dominiontabs/card_db/en_us/card_groups.json') as data_file: | |
groupDict = json.load(data_file) |
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
// | |
// Created by Nick Vance on 12/4/15. | |
// Copyright © 2015 ToWatchList. All rights reserved. | |
// | |
import AVKit | |
import XCDYouTubeKit | |
import TVMLKit | |
class YTPlayerViewController: AVPlayerViewController, AVPlayerViewControllerDelegate { |
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 python | |
def medfilt (x, k): | |
"""Apply a length-k median filter to a 1D array x. | |
Boundaries are extended by repeating endpoints. | |
""" | |
import numpy as np | |
assert k % 2 == 1, "Median filter length must be odd." | |
assert x.ndim == 1, "Input must be one-dimensional." |