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
# To use gitprompt to set your prompt to include a colored git branch label: | |
# bash: | |
# source gitprompt | |
# bash_colors | |
# PS1='[\[$(git_branch_color)\]$(parse_git_branch)\[${NORMAL}\]] '"$PS1" | |
# zsh: | |
# source gitprompt | |
# zsh_colors | |
# setopt PROMPT_SUBST | |
# export PROMPT='[%F{$(git_branch_color)}$(parse_git_branch)%f] %B%F{240}%~%f %# ' |
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
# enable colorized terminal output | |
export CLICOLOR=1 | |
# Parse display and control chars in the less pager | |
export LESS=-R | |
# Set default editor for terminal tasks to emacs | |
export EDITOR=emacs | |
# Moved to .zshrc | |
eval $(/opt/homebrew/bin/brew shellenv) |
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
# Slightly odd to inherit from Module; this lets us define consts such as FOOBAR::FOO | |
class Enum < Module | |
include Enumerable | |
attr_reader :values | |
delegate :each, to: :values | |
def initialize(&blk) | |
super(&nil) # Don't pass the block to super |
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
git fetch -p | |
git branch -vv | \ | |
awk '$3 ~ /\[[[:punct:][:alnum:]]+:/ && $4 == "gone]" { print $1}' | \ | |
while read branch; do echo git branch -D $branch; git branch -D $branch; 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
import pytest | |
import requests_mock | |
# By autousing this yielding fixture, all tests with have requests_mock enabled with | |
# the registered stubbed responses as defined here | |
@pytest.fixture(autouse=True) | |
def stub_or_disable_requests(): | |
with requests_mock.Mocker() as mocker: | |
mocker.get('//example.com/mock1', text='example.com mock 1') |
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
USAGE="clean_old_remote_branches.sh | |
Remove branches from remote older than a specified threshold. | |
Arguments: | |
-h : print this message | |
-n, --dry-run : print actions, do not take them. | |
-d, --days : threshold for \"old\", in days. Default: 200 |
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
# To use gitbranch to set your prompt to include a colored git branch label: | |
# bash: | |
# source .gitbranch | |
# bash_colors | |
# PS1='[\[$(git_branch_color)\]$(parse_git_branch)\[${NORMAL}\]] '"$PS1" | |
# zsh: | |
# source .gitbranch | |
# zsh_colors | |
# setopt PROMPT_SUBST | |
# export PROMPT='[%F{$(git_branch_color)}$(parse_git_branch)%f] %B%F{240}%~%f %# ' |
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
bash_colors() { | |
export BLACK=$(tput setaf 0) | |
export RED=$(tput setaf 1) | |
export GREEN=$(tput setaf 2) | |
export YELLOW=$(tput setaf 3) | |
export BLUE=$(tput setaf 4) | |
export MAGENTA=$(tput setaf 5) | |
export CYAN=$(tput setaf 6) | |
export WHITE=$(tput setaf 7) | |
export NORMAL=$(tput sgr0) |
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
class InpsectionsController < ApplicationController | |
def index | |
log | |
head :ok | |
end | |
def create | |
log | |
head :ok | |
end |
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 | |
# In[1]: | |
# import libraries | |
import boto3, re, sys, math, json, os, sagemaker, urllib.request | |
from sagemaker import get_execution_role | |
import numpy as np |
NewerOlder