Skip to content

Instantly share code, notes, and snippets.

View camtheman256's full-sized avatar
💼

Cameron Kleiman camtheman256

💼
View GitHub Profile
@camtheman256
camtheman256 / parenmatch.py
Created November 26, 2023 22:27
Log-space parentheses matcher.
def parens(s: str):
def parser_paren(i: int) -> tuple[bool, int]:
i += 1
result = True
while i < len(s) and result and s[i] != ")":
if s[i] == "(":
result, i = parser_paren(i)
elif s[i] == "[":
result, i = parser_bracket(i)
else:
@camtheman256
camtheman256 / export_when2meet.js
Created February 28, 2021 22:16
Export when2meet data from JS console
function exportData() {
const peopleMap = {};
for(let i = 0; i < PeopleIDs.length; i++) {
peopleMap[PeopleIDs[i]] = PeopleNames[i];
}
nameAtSlot = AvailableAtSlot.map(e => e.map(i => peopleMap[i]));
timedNames = TimeOfSlot.map((e, i) => [e, nameAtSlot[i]]);
return JSON.stringify(timedNames);
}
@camtheman256
camtheman256 / changeColorToMusic.js
Last active July 7, 2020 02:17
Change Color to Music for Spicetify
// @ts-check
// NAME: Change Color to Music
// AUTHOR: camtheman256
// DESCRIPTION: Changes accent color to album art
/// <reference path="../globals.d.ts" />
(function ChangeColorToMusic() {
function applyStyles(styleMap, documentEl) {
for(style of Object.keys(styleMap)) {
@camtheman256
camtheman256 / delete.py
Created June 9, 2019 21:14
Couple methods to delete all tweets and likes with tweepy API
#!/usr/bin/python3
# ================================================
# Tips: pip3 install tweepy before you get started
# You'll also need to set up a developer account
# and application on developer.twitter.com in
# order to get the necessary keys/secrets
#
# Enjoy! Cameron Kleiman, 2019
# ================================================

Keybase proof

I hereby claim:

  • I am camtheman256 on github.
  • I am ckleiman15 (https://keybase.io/ckleiman15) on keybase.
  • I have a public key whose fingerprint is 57D9 DE58 510C 30EA 3FAD 1153 DE5A 16EA 7FE6 CEA9

To claim this, I am signing this object:

@camtheman256
camtheman256 / Pencil.java
Last active January 11, 2018 23:14
A tutorial created by Cameron Kleiman, Lauren Mangibin, and Nirali Devgan to demonstrate the abilities of objects in Java for AP Computer Science class at LASA.
public class Pencil {
private int pencilSharp;
private String pencilColor;
public Pencil(){
pencilSharp = 3;
pencilColor = "yellow";
}
public Pencil(int sharp, String color) {