Skip to content

Instantly share code, notes, and snippets.

View CatherineH's full-sized avatar

Catherine Holloway CatherineH

View GitHub Profile
@CatherineH
CatherineH / app-engine.sh
Created March 2, 2017 22:30
run app-engine locally, as a service
#!/bin/sh
### BEGIN INIT INFO
# Provides: appengine
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: runs an instance of dev_appserver
### END INIT INFO
@CatherineH
CatherineH / thread_monitor.py
Created March 2, 2017 22:04
an example of a python script that watches all threads for early termination
from threading import Thread, enumerate
import logging
def fails():
for i in range(999999999):
assert i < 9999999
def succeeds():
@CatherineH
CatherineH / git-latest.py
Created March 1, 2017 19:09
Python script to checkout the latest commit across all remote branches
from commands import getstatusoutput
def branches(remote=False):
command = "git branch" + (" -r" if remote else "")
return [br.strip() for br in getstatusoutput(command)[1].replace("*", "").split("\n")]
local_branches = branches()
remote_branches = branches(remote=True)
import UI.NCurses
import Control.Monad (forM_)
import Data.Int
num_accross = 24
num_down = 9
colors = [ColorMagenta, ColorRed, ColorYellow, ColorGreen, ColorBlue, ColorCyan, ColorWhite, ColorBlack]
main = runCurses $ do
@CatherineH
CatherineH / buttonbox.hs
Created December 13, 2016 17:47
recursive monad gui
module Main (main) where
import Graphics.UI.Gtk
import Data.List.Split
poem = "Best Witchcraft is Geometry To the magician’s mind His ordinary acts are feats To thinking of mankind."
makebuttonbox :: [String] -> IO HBox
makebuttonbox [] = do
#!/bin/bash
# GUI-related packages
pkgs="
xserver-xorg-video-fbdev
xserver-xorg xinit
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa
gstreamer1.0-libav
epiphany-browser
<filetype binary="false" description="Verilog" name="Verilog">
<highlighting>
<options>
<option name="LINE_COMMENT" value="//" />
<option name="COMMENT_START" value="/*" />
<option name="COMMENT_END" value="*/" />
<option name="HEX_PREFIX" value="" />
<option name="NUM_POSTFIXES" value="" />
<option name="HAS_PARENS" value="true" />
<option name="HAS_STRING_ESCAPES" value="true" />
import os
import urllib
import urllib2
import ast
import wget
from PIL import Image
from collections import Counter
service = "https://datamarket.accesscontrol.windows.net/v2/OAuth2-13"
# you will need to generate your own client id and key in Azure
__author__ = 'cholloway'
import argparse
from OdomProcessor import OdomProcessor
parser = argparse.ArgumentParser(description='Process odometries in bag file.', argument_default=argparse.SUPPRESS)
parser.add_argument('--data_topics', type=list, nargs='+', help='The odometry topic')
parser.add_argument('--labels', type=list, nargs='+', help='The topic labels for the graphs')
parser.add_argument('--foldername', type=list, nargs='?', help='The foldername containing the bags')
parser.add_argument('--filename', type=str, nargs='?', help='The filename of the bag')