Skip to content

Instantly share code, notes, and snippets.

TMiguelT / aws-creds.bash
Created Nov 5, 2018 — forked from ddgenome/aws-creds.bash
Fetch AWS STS keys and set environment variables
View aws-creds.bash
# Fetch 24-hour AWS STS session token and set appropriate environment variables.
# See .
# You must have jq installed and in your PATH .
# Add this function to your .bashrc or save it to a file and source that file from .bashrc .
function aws-creds () {
local pkg=aws-creds
TMiguelT / .vimrc
Created Aug 18, 2017
Colemak Vim Config
View .vimrc
" Always use the system clipboard
set clipboard=unnamed
" X deletes without adding to the register
noremap x "_x
vnoremap x "_x
" Colemak key bindings
noremap n h
noremap e j
def suppress_outputs(suppress_stdout=True, suppress_stderr=True):
Context manager that can be used to suppress any printing to sdtout or stderr from any python
code within its context
#Open /dev/null
null = open(os.devnull, 'w')
TMiguelT /
Created Feb 27, 2017
Script to run a DNA Nexus app from inside the app, with the same environment as it would be run automatically
# Replace the job-* file with the right job ID
sudo -E PYTHONPATH=$PYTHONPATH bash job-F2kfkk804G2KyYvvF3fKffy2
TMiguelT / tcgplayer_to_csv.js
Last active May 2, 2017
Script to create a CSV out of the Cart Review Page of TCGPlayer
View tcgplayer_to_csv.js
let str = ''
let tables = Array.from($('.sellerWrapMarket'))
for (let table of tables){
let $table = $(table)
let rows = Array.from($table.find('table.sellerTable'))
for (let row of rows){
let $row = $(row)
// Card name
str += $row.find('.itemsContents h3').text() + '\t'
TMiguelT / mtgjson to csv
Created Sep 11, 2016
Bash script to convert mtgjson's AllCards.json into a csv format
View mtgjson to csv
# Download the database
# Unzip it
# Convert to CSV
jq -r 'to_entries[] | [.key, (.value | tostring ) ] | @csv' AllCards.json > AllCards.csv
# Load into postgres
You can’t perform that action at this time.