Skip to content

Instantly share code, notes, and snippets.

View PatheticMustan's full-sized avatar
🌠
starry eyed

Nat PatheticMustan

🌠
starry eyed
View GitHub Profile
Album Rating
[10/10/2023] Wallsocket - underscores
<7>, the album uses a lot of off beats in an interesting way.
I liked the instrumentals in Geez Louise (and the drop!?!?!?).
My favorite song was "Locals (Girls like us) [with gabby start]"
"Seventyseven dog years" was also pretty good.
Instrumentals in "Uncanny long arms" was good
[10/11/2023] Transatlanticism (10th Anniversary Edition) - Death Cab for Cutie
function PK(m, v) {
const round = n => Math.round(n*1000)/1000;
console.log(`P: ${round(m*v)} K: ${round(0.5*m*(v**2))}`);
}
@PatheticMustan
PatheticMustan / BinarySearchTree.java
Last active October 10, 2023 04:01
vague spec and no clarification from TAs... what do they even want from us
class Node {
// properties
private Node left;
private Node right;
private int value;
// getters
public Node getLeft() { return left; }
public Node getRight() { return right; }
public int getValue() { return value; }
// setters
import java.lang.StringIndexOutOfBoundsException;
import java.util.Scanner;
public class Palindrome {
// Part 1
// O(n)
public static boolean palindromeIterative(String input) {
// filter text so it only contains lowercase letters and numbers
input = input.toLowerCase().replaceAll("[^a-z0-9]", "");
// pairs the first half to the second half, so we only
@PatheticMustan
PatheticMustan / labStuff.js
Created September 7, 2023 15:07
calculate mean, std dev, and std err
function magic(a) {
let N = a.length;
let mean = a.reduce((a,b)=>a+b,0) / N;
let sd = 0;
for (let i=0; i<a.length; i++) {
sd += ((a[i] - mean) ** 2);
}
sd /= N - 1;
const fs = require('fs'),
request = require('request');
const download = (uri, filename, callback) => {
request.head(uri, (err, res, body) => {
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);
});
};
@PatheticMustan
PatheticMustan / clean.js
Created July 9, 2023 17:20
remove dupe photos
const testFolder = './';
const fs = require('fs');
let n = 0;
fs.readdir(testFolder, (err, files) => {
files.forEach(file => {
if (file.includes("(1)") || file.includes("(2)") || file.includes("(3)")) {
//console.log(file);
n++;
@PatheticMustan
PatheticMustan / bibletime.js
Created June 15, 2023 04:37
how many minutes does it take to read the bible on average?
x = `Genesis – 3.5h
Exodus – 3h
Leviticus – 2h
Numbers – 3h
Deuteronomy – 2.5h
Joshua – 1.75h
Judges – 1.75h
Ruth – 15m
1 Samuel – 2.25h
2 Samuel – 1.75h
@PatheticMustan
PatheticMustan / letterboxd_unbf_v2.js
Last active May 30, 2023 00:17
enumerating for three letter usernames in letterboxd
const alphabet = "abcdefghijklmnopqrstuvwxyz0123456789_";
let final = []
const runLetter = (async (letter) => {
const results = [];
console.log(`STARTING WITH ${letter}`);
console.time(`COMPLETED ${letter}`);
for (let i=0; i<alphabet.length; i++) {
for (let o=0; o<alphabet.length; o++) {
@PatheticMustan
PatheticMustan / letterboxd_unbf_2.js
Last active May 29, 2023 20:10
just give me a short username already
let alphabet = "abcdefghijklmnopqrstuvwxyz";
(async () => {
for (let i=0; i<26; i++) {
for (let o=0; o<26; o++) {
let name = alphabet[i] + alphabet[o];
const res = await fetch(`https://letterboxd.com/s/checkusername?q=${name}&limit=10&timestamp=${Date.now()}`);
// log result
const data = (await res.json()).data;