Skip to content

Instantly share code, notes, and snippets.

View t-mart's full-sized avatar

Tim Martin t-mart

View GitHub Profile
local function difference(after, before)
return after - before
end
local function hms(seconds)
local hours = floor(seconds / 3600)
local minutes = floor((seconds % 3600) / 60)
local sec = floor(seconds % 60)
return hours, minutes, sec
end
@t-mart
t-mart / foo.v
Last active August 29, 2015 14:08
module pipeRegister(clk, reset,
stall,
regWrEnIn, memWrEnIn, mulSelIn, aluOutIn, PCIn, instrTypeIn, isBranchTakenIn,
regWrEnOut, memWrEnOut, mulSelOut, aluOutOut, PCOut, instrTypeOut, isBranchTakenOut
);
parameter BIT_WIDTH = 32;
input clk, reset;
input stall;
.pie_arc {
font-size: 0.75em;
}
.distillery {
font-weight: bold;
}
#svg {
text-align: center;
@t-mart
t-mart / README.md
Last active August 29, 2015 14:07 — forked from mbostock/.block

For continuous data such as time series, a streamgraph can be used in place of stacked bars. This example also demonstrates path transitions to interpolate between different layouts. Streamgraph algorithm, colors, and data generation inspired by Byron and Wattenberg.

def list_condense(l):
run_start = None
in_run = False
last_item = None
out = ''
while len(l):
item = l.pop(0)
if not in_run:
run_start = item
class Node(object):
def __init__(self, name, lc=None, rc=None):
self.name = name
self.lc = lc
self.rc = rc
self.rn = None
# THE MEAT OF THE PROBLEM
@staticmethod
def link_rn(level_list):
curl "https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py" | sudo python3.3
curl "https://raw.github.com/pypa/pip/master/contrib/get-pip.py" | sudo python3.3
sudo pip install virtualenv
@t-mart
t-mart / gist:5165953
Created March 14, 2013 22:52
good way to get time data
#!/bin/bash
#strace
# "-e trace=some_syscall" allows you to trace just the syscalls you want.
# lotta noise otherwise. comma separated list, but
# for our experiments, it'll prolly just be 1
# syscall
# "-T" give us time data
#
# "program arg0 arg1" is the program we want to trace. this'll likely be
@t-mart
t-mart / backup.sh
Created December 11, 2012 20:23
Local incremental backup of Windows' drives with RSync via Cygwin.
#!/bin/sh
#Local incremental backup of Windows' drives with RSync via Cygwin.
#Run like ./backup.sh cat_pictures_drive d g
#where d is the drive containing cat pictures
#and g is the destination of the backup.
#Backups will be made on g like G:\cat_pictures_drive_backup\backup-YY-MM...
#high-level description of the content we're backing up
@t-mart
t-mart / git_aliases.txt
Created October 15, 2012 22:55
My git aliases
Status
gst='git status'
gss='git status -s'
gstv='git status -v'
Remotes
gp='git push'
gl='git pull'
glom='git pull origin master'
ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'