Skip to content

Instantly share code, notes, and snippets.

View joshuagruenstein's full-sized avatar
🤖

Josh Gruenstein joshuagruenstein

🤖
View GitHub Profile
@joshuagruenstein
joshuagruenstein / curve plotting
Created April 25, 2017 04:41
Kinematics plotting for Siney
Export["siney.gif",
Table[
Show[Graphics[
Translate[
Rotate[{Circle[], Thick, Blue, Line[{{0, 0}, {0, -1}}], Red,
PointSize[.02], Point[{0, -1}]}, t], { 2 Pi, 0}],
PlotRange -> {{0, 4 Pi}, {-2, 2}}, ImageSize -> {Large, Tiny},
Axes -> {True, False}, AxesOrigin -> {0, -1}],
Graphics[
Plot[Sin[x + t - Sin[t] + 3*Pi/2], {x, -4 Pi, 4 Pi}]
@joshuagruenstein
joshuagruenstein / BasicTronBot.java
Created May 23, 2016 18:50
A simple Java TronBot that tries not to die.
import java.util.*;
import java.io.*;
public class TronBot {
public static void main(String[] args) {
// Call this to initialize networking and the debug file
Tron.init();
// We can't print to console, because that channel is used for IO with the environment.
// We therefore print to either debug1.log or debug2.log. The first is for player1, the second for layer two
@joshuagruenstein
joshuagruenstein / satChecker.py
Created January 22, 2016 02:16
A python notifier for SAT cancellations.
import requests
from BeautifulSoup import BeautifulSoup
import time
from Foundation import NSUserNotification
from Foundation import NSUserNotificationCenter
from Foundation import NSUserNotificationDefaultSoundName
from optparse import OptionParser
def notify(school):
@joshuagruenstein
joshuagruenstein / goddamnit.cpp
Created September 20, 2015 01:05
i hate you right now
double movingAvg(double avg, double newVal, double len) {
avg -= avg/len;
avg += newVal/len;
return avg;
}