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
;; -*- coding: utf-8 -*- | |
;; starcraft.el -- track user APM (actions per minute) while using Emacs | |
;; | |
;; Copyright 2010 by Michael Steder | |
;; Author: Michael Steder (steder@gmail.com) | |
;; Created: 2010 | |
;; Version: 1.0 | |
;; Keywords: Actions per minute | |
;; | |
;; Inspired by a love of Starcraft and someones offhand comment |
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 | |
""" | |
Recipe for creating and updating security groups programmatically. | |
""" | |
import collections | |
import boto |
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 | |
#-*- mode: python -*- | |
from subprocess import Popen, PIPE | |
import sys | |
syntax_checker = "pyflakes" | |
def run(command): | |
p = Popen(command.split(), stdout=PIPE, stderr=PIPE) |
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
# This is a little slow, so we cache it so we're not running a slow | |
# find on every terminal startup: | |
if [[ -e ~/.cache/zsh_exports_gnubin ]]; then | |
gnubins=(${(ps:\n:)"$(cat ~/.cache/zsh_exports_gnubin)"}) | |
else | |
gnubins=(${(ps:\n:)"$(find /usr/local/opt -type d -follow -name gnubin -print | tee ~/.cache/zsh_exports_gnubin)"}) | |
fi | |
for bindir in $gnubins; do | |
export PATH=$bindir:$PATH; |
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 time | |
from boto.ec2.autoscale import AutoScaleConnection | |
def find_unused_launch_configs(): | |
conn = AutoScaleConnection() | |
autoscale_groups = conn.get_all_groups(max_records=100) | |
launch_configs = conn.get_all_launch_configurations(max_records=100) | |
launch_config_names = {lc.name for lc in launch_configs} |
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 bash | |
GOPATH=~/go/src | |
# Just include this function in your ~/.bashrc | |
function gof { | |
if (( $# == 0 )); then | |
echo "usage: $gof <dir>" | |
echo "jumps to $GOPATH/src directory matching <dir>" | |
return |
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
require 'rubygems' | |
require 'nokogiri' | |
require 'fileutils' | |
require 'date' | |
require 'uri' | |
# usage: ruby import.rb my-blog.xml | |
# my-blog.xml is a file from Settings -> Basic -> Export in blogger. | |
data = File.read ARGV[0] |
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 itertools | |
class Dictionary(object): | |
def __init__(self): | |
self.words = {} | |
def insert(self, word): | |
letters = "".join(sorted(word)) | |
if letters not in self.words: | |
self.words[letters] = [word] |
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 os | |
import re | |
import subprocess | |
import sys | |
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)') | |
CHECKS = [ |
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 | |
# nosy: commandline continuous integration for test driven development | |
# | |
# Copyright (C) 2008 Michael Steder <steder@gmail.com> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
NewerOlder