Skip to content

Instantly share code, notes, and snippets.

View PatheticMustan's full-sized avatar
🌠
starry eyed

Nat PatheticMustan

🌠
starry eyed
View GitHub Profile
@PatheticMustan
PatheticMustan / colorViewer.js
Last active December 1, 2023 23:18
a small christmas gift for my darling beloved
const content = `beetle:
arms/legs: #738334
antennae: #4a5224
back primary: #04ab44
back highlights: #7adb8b
eyes: #2f2f2f
octopus:
primary: #ff615e
tentacle highlight: #ffa8a8
refinement of articles
run 1
summarize paragraph by paragraph
bulletpoint evidence
run 2
summarize overall ideas
bulletpoint concepts
fetch("https://apply.vandyhacks.org/api/leaderboard")
.then(v => v.json())
.then(v => {
x = v;
console.log("TEAM CODES:\n\n" + Array.from(new Set(v.map(v => [v.team?.name, v.team?.joinCode].join(": ")))).filter(v => v !== ": ").join("\n"));
console.log("EMAILS:\n\n" + Array.from(new Set(v.map(v => v.email))).filter(v => v).join("\n"))
})
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++;