View account_tweets.py
"""
Script for printing out tweets from a given account
Sample usage:
python account_tweets.py qikipedia
"""
import twitter
import sys
View values.py
import typing
import datetime
class Period(typing.NamedTuple):
"""
Value object representing a period in time
"""
start_dt: datetime.datetime # noqa (as flake8 doesn't support this syntax as of v3.3)
end_dt: datetime.datetime # noqa
View .bashrc
# ======
# PROMPT
# ======
# Set the prompt
# - Specify colors using \e[31;40m where 31 is the color and 40 is the background or
# - Select 1 for bold.
# - Wrap color specifiers in \[ and \] to ensure they don't affect word wrapping
# - Colours 30=black, 31=red, 32=green, 33=yellow, 34=blue, 35=purple, 36=teal, 37=white
View .gitconfig
[user]
name = David Winterbottom
email = david.winterbottom@gmail.com
[alias]
# SHORT VERSIONS
co = checkout
ci = commit
View boo
#!/usr/bin/env bash
#
# Show an OSX alert
#
# This is useful when used in conjunction with a long-running script. Use this script to
# get a notification when te long-running script finishes.
#
# Eg:
#
# $ ./someprocess ; boo
View userdata.sh
#!/bin/bash
DEVICE=/dev/$(lsblk -n | awk '$NF != "/" {print $1}')
FS_TYPE=$(file -s $DEVICE | awk '{print $2}')
MOUNT_POINT=/data
# If no FS, then this output contains "data"
if [ "$FS_TYPE" = "data" ]
then
echo "Creating file system on $DEVICE"
View osx_bootstrap.sh
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
View prettytitle.sh
#!/usr/bin/env bash
# Pretty printing function for Bash output
#
# Example usage:
#
# $ notify "hello world"
#
# +-------------+
# | hello world |
View user-data.sh
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {