Skip to content

Instantly share code, notes, and snippets.

View jkeesh's full-sized avatar

Jeremy Keeshin jkeesh

View GitHub Profile
@jkeesh
jkeesh / create_repo.py
Last active January 1, 2024 00:31
Python script to create a remote git repo that checks out the latest commit with a post-receive hook
#
# This script creates a repository and sets it up with a post receive
# hook that checks out the code to the desired directory.
#
# Really nice for setting up an easy way to push code to a remote
# server without lots of overhead.
#
# After running this script simply add a remote locally like
#
# git remote add web ssh://you@server/path/to/repo.git
@jkeesh
jkeesh / indenting.js
Last active January 26, 2017 01:45
New indenting style for beginners
function start()
{
if(frontIsClear())
{
move();
}
else
{
putBall();
}
@jkeesh
jkeesh / lookandsay.py
Created September 29, 2013 02:22
Look and Say
import sys
SENTINEL = -1
def lookandsay(num):
"""Return the look and say version of num."""
num = str(num)
@jkeesh
jkeesh / lexicon.js
Created January 4, 2014 08:13
proof of concept lexicon
function Lexicon(file){
this.data = {
'a': {
'b': {
's': {}
}
}
};
}
@jkeesh
jkeesh / uber_report.py
Created January 11, 2015 01:32
uber reporting
import csv
import sys
import pprint
FIRST_ROW = 6
DATE_INDEX = 1
EMAIL_INDEX = 7
FARE_INDEX = 14
import java.util.*;
public class ConsoleProgram{
private Scanner scanner;
public static void main(String[] args){
// Assume the class name is passed in as the first argument.
if(args.length == 0){
@jkeesh
jkeesh / Randomizer.java
Created July 16, 2015 23:21
Randomizer - Java
import java.util.*;
public class Randomizer{
public static Random theInstance = null;
public Randomizer(){
}
import java.util.*;
import java.lang.*;
public class ObjectTracker{
// Code for grader
private static HashMap<String, ArrayList<Object>> objTracker = new HashMap<String, ArrayList<Object>>();
// create instancetracker
private static final int CALLER_INDEX = 3;
Verifying that +jkeesh is my blockchain ID. https://onename.com/jkeesh
@jkeesh
jkeesh / Grader.java
Created September 18, 2016 18:31
SnackPack Grader
import java.util.*;
public class Grader
{
public static void runInputTest(Autograder grader, String[] inputs, String message)
{
// Create a student program
SnackPack studentProgram = new SnackPack();