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 | |
import fileinput | |
from collections import Counter | |
def compress_list(_list, tree=None): | |
"""Compress the list""" | |
if tree is None: | |
tree = [] |
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 | |
""" | |
http://www.acsl.org/17-18/allstar/2.%20Compressed%20Lists.pdf | |
""" | |
import fileinput | |
from collections import Counter | |
def compress_list(_list, frequency, out=None): | |
if out is None: |
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
2017/05/02 15:39:47 [INFO] Packer version: 1.0.0 | |
2017/05/02 15:39:47 Packer Target OS/Arch: darwin amd64 | |
2017/05/02 15:39:47 Built with Go Version: go1.8 | |
2017/05/02 15:39:47 [DEBUG] Discovered plugin: amazon-chroot = <redacted>/bin/packer-builder-amazon-chroot | |
2017/05/02 15:39:47 [DEBUG] Discovered plugin: amazon-ebs = <redacted>/bin/packer-builder-amazon-ebs | |
2017/05/02 15:39:47 [DEBUG] Discovered plugin: amazon-instance = <redacted>/bin/packer-builder-amazon-instance | |
2017/05/02 15:39:47 [DEBUG] Discovered plugin: digitalocean = <redacted>/bin/packer-builder-digitalocean | |
2017/05/02 15:39:47 [DEBUG] Discovered plugin: docker = <redacted>/bin/packer-builder-docker | |
2017/05/02 15:39:47 [DEBUG] Discovered plugin: file = <redacted>/bin/packer-builder-file | |
2017/05/02 15:39:47 [DEBUG] Discovered plugin: googlecompute = <redacted>/bin/packer-builder-googlecompute |
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/bash | |
# A shell utility to help bootstrap python packages | |
# Author: Glen Zangirolami | |
# https://github.com/glenbot | |
set -o nounset | |
set -o errexit | |
# Check for dependencies | |
function check_dependencies() { | |
local GIT_INSTALLED=$(which git) |
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 | |
""" | |
Stress test a web site | |
Usage: | |
stress_test_replay [options] | |
Options: | |
--host=<host> The host to connect to [default: http://www.example.com]. |
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
""" | |
Demonstration of ways to implement this API: | |
sanitize(user_input, stop_words) | |
Related discussions: | |
- Modifying a list while looping over it: | |
- http://stackoverflow.com/questions/1207406/remove-items-from-a-list-while-iterating-in-python | |
- Remove all occurences of a value in a list: | |
- http://stackoverflow.com/questions/1157106/remove-all-occurences-of-a-value-from-a-python-list |
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 | |
# Due Date Notifier - Notify VIA SMS (SendHub) when a bill is going to be due | |
# * Requires a SendHub account (free) - http://sendhub.com | |
# * Has python package dependencies: simplejson, requests | |
# * Recommend putting this on a crob job running once a day | |
# I like my text messages at at 11am | |
# | |
# NOTE: Sendhub free accounts allow only 500 requests to the API per month. | |
# This should suffice assuming the amount of bills you pay arent loco. | |
# |
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/bash | |
# Configuration files | |
TEMP_CONFIG="/tmp/gitswitchrc" | |
ALT_SSH_CONF="$HOME/.ssh/id_rsa_gitswitch" | |
BASHRC="$HOME/.bashrc" | |
# PS1 prompt pre-text | |
# Places some text behind your command prompt to give | |
# a context clue that you are within another GIT context. |
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 | |
""" | |
OSX ONLY! | |
Monitor OSX application usage from your shell | |
and at the end of the day see how much you don't | |
work ;) | |
Author: Glen Zangirolami | |
http://theglenbot.com |
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/bash | |
# Try and get debian operating system | |
# id, codename, and release | |
get_debian_os_meta() { | |
OS=$(uname) | |
ID="unknown" | |
CODENAME="unknown" | |
RELEASE="unknown" |
NewerOlder