Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chmullig
chmullig / RescueTimeExport.py
Created March 22, 2018 04:14 — forked from veekas/RescueTimeExport.py
RescueTime Data Export
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# RescueTime Data Exporter
# Dan Nixon
# 18/09/2011
# forked from Chris Burgess (xurizaemon)
import urllib
import datetime
module section(width, depth, height, border, base) {
difference(){
cube([width+2*border, depth+2*border, height+base]);
translate([border, border, base])cube([width, depth, height]);
}
}
border = 4;
width = 11;
depth = 15;
@chmullig
chmullig / README
Last active July 10, 2021 01:53
Columbia LDAP lookup
Install pyldap (per requirements.py).
Example Usage:
Chris-retina:ldap chmullig$ cat members_head.csv
email
clm2186@columbia.edu
ashutosh.nanda@columbia.edu
Chris-retina:ldap chmullig$ python2.7 ldap_lookup.py members_head.csv
1 []
require(dplyr)
require(reshape2)
require(ggplot2)
mturk <- read.csv("What-If-Games-Were-Shorter-Data-MTurk.csv")
head(mturk)
tallturk <- melt(mturk, id.vars=c("ID"), variable.name="quarter", value.name="fav_win_prob")
tallturk <- tallturk[tallturk$quarter %in% c("FavWinProbQ1", "FavWinProbQ2", "FavWinProbQ3", "FavWinProbQ4"),]
@chmullig
chmullig / Makefile
Last active August 29, 2015 14:08
simple python script to recode gcc mips assembly output to use nice register names
CC=mipsel-unknown-linux-gnu-gcc
CFLAGS=-Wall -static -fno-inline-small-functions -S
default: palindrome_nice.s palindrome_O1_nice.s palindrome_O2_nice.s palindrome_O3_nice.s palindrome_32r2_nice.s countzeroes_nice.s countzeroes_O1_nice.s countzeroes_O2_nice.s countzeroes_O3_nice.s countzeroes_32r2_nice.s
%_nice.s: %.s recode_gcc.py
python recode_gcc.py < $< > $@
%.s: %.c
@chmullig
chmullig / 0_point.java
Last active August 29, 2015 14:06
point-distance
public class Point {
private double x;
private double y;
public Point(double x, double y) {
this.x = x;
this.y = y;
}
public double distance(Point that) {
@chmullig
chmullig / StringLiteralsTest.cpp
Last active December 30, 2015 05:19
Testing String Literal comparisons
#include <iostream>
#include <cstdio>
int main() {
std::cout << "\"hello\" == \"world\" = " << ("hello" == "world") << std::endl;
std::cout << "\"hello\" == \"hello\" = " << ("hello" == "hello") << std::endl;
std::cout << "\"hello\" < \"world\" = " << ("hello" < "world") << std::endl;
std::cout << "\"hello\" < \"abc\" = " << ("hello" < "abc") << std::endl;
printf("hello is @ %p\n", "hello");
@chmullig
chmullig / README.md
Last active December 17, 2015 02:39
Summarize coms3157 commits

CS3157 Stats

This is a simple project to create summary statistics about Jae Woo Lee's COMSW3157 Advanced Programming class at Columbia: http://www.cs.columbia.edu/~jae/

This started as a way to familiarize myself with ruby before an internship this summer requires me to use it. This turned into a script that parses the submitted git patches to look at who commited which lab when, and what they changed.

The result is entirely anonymous in terms of both name and content. Each time