Skip to content

Instantly share code, notes, and snippets.

View tillson's full-sized avatar

Tillson Galloway tillson

View GitHub Profile
@tillson
tillson / gist:620e8ef87bc057f25b0a27c423433fda
Created May 10, 2020 19:22
Decode Base64 strings in a git repo's commit history
from pydriller import RepositoryMining
import re
import base64
foundSet = set()
for commit in RepositoryMining('./').traverse_commits():
for mod in commit.modifications:
if mod.source_code_before != None:
regex = re.findall(r"<text encoding=\"base64\">[^>]+</text>", mod.source_code_before)
for result in regex:
### Keybase proof
I hereby claim:
* I am tillson on github.
* I am ttg (https://keybase.io/ttg) on keybase.
* I have a public key whose fingerprint is 14F1 D442 FD1C 4A67 1D55 CD73 DBFC A31E 1B06 5864
To claim this, I am signing this object:
@tillson
tillson / externalchaining.java
Last active February 27, 2019 04:22
Print a HashMap that uses external chaining
public void printString() {
int i = 0;
while (i < table.length) {
MapEntry<K, V> entry = table[i];
System.out.print(i + ": ");
while (entry != null) {
System.out.print(entry.getKey() + " -> ");
entry = entry.getNext();
}
System.out.println("");
@tillson
tillson / Tests.java
Last active November 30, 2018 16:08
Implementation tests for CS 1331 hw7
/**
* Tests for hw7
* @author Tillson Galloway
* @version 1.0.4
*/
public class Tests {
// if the output of the tests have weird symbols instead of colors, set this to false (generally a problem on Windows)
private final static boolean USE_COLORS = true;
@tillson
tillson / taylor.swift
Last active November 14, 2018 22:11
taylor.swift
//: Calculate the value of pi by integrating arctan's Taylor Series
/*:
arctan(1) - arctan(0) == integral of 1/(1+x^2) from 0 to 1
arctan(1) - 0 = pi/4
the sum 1/(1+x^2) is geometric, we can rewrite in the form of Sn = 1/1-r in order to easily write it as a taylor series
Sn = 1/(1 - (-x^2))
taylor series for arctan is therefore (-x^2)^n
= (-1)^n * (x^2n)
@tillson
tillson / Tests.java
Last active November 21, 2018 04:55
Implementation tests for CS 1331 hw6.
import java.util.ArrayList;
import java.util.List;
/**
* Tests for hw6
* @author Tillson Galloway
* @version 1.1.2
*/
public class Tests {
@tillson
tillson / exporter.py
Last active September 8, 2022 21:58
Quick little script to export Apple Watch heart rate data for a given day into CSV format
#!/usr/bin/env python
import sys
"""
Daily heart rate exporter
Turns Apple Health app export for a given day into a simple csv file
Params:
input file - Input file (.xml format, by default after export is export.xml)
date - YYYY-MM-DD format
(optional) outputFile - CSV output file location
@tillson
tillson / schedulefix.js
Last active June 5, 2016 04:25
WWDC Schedule Fix, as it doesn't work as of 5 June 2016 (https://developer.apple.com/wwdc/schedule/#/)
for(i=0;5>i;i++)angular.element($(".center")).scope().filters[0].options[i].value=+new Date(2016,5,i+13);$(".active").click()
@tillson
tillson / keybase.md
Created March 13, 2014 01:27
keybase.md

Keybase proof

I hereby claim:

  • I am tillson on github.
  • I am ttg (https://keybase.io/ttg) on keybase.
  • I have a public key whose fingerprint is A767 598E E16F 8A98 CA07 B7A3 4A63 068F 1918 6869

To claim this, I am signing this object: