Skip to content

Instantly share code, notes, and snippets.

View sudofox's full-sized avatar
🕟
turning back the clock

Austin Burk sudofox

🕟
turning back the clock
View GitHub Profile
@sudofox
sudofox / universal_paperclips_helper.user.js
Created October 1, 2024 15:20
A helper script for the Universal Paperclips game. Eventually it might play the game for you.
// ==UserScript==
// @name Universal Paperclips Helper
// @namespace universal-paperclips-helper
// @description A helper script for the Universal Paperclips game. Eventually it might play the game for you.
// @include https://www.decisionproblem.com/paperclips/index2.html
// @version 12
// @grant none
// @author sudofox, takayatodorokif1
// ==/UserScript==
@sudofox
sudofox / cookie_clicker_prestige_delta_tracker.user.js
Last active September 3, 2024 14:06
Track and graph the change in prestige level over time in Cookie Clicker.
@sudofox
sudofox / listen.py
Created March 28, 2024 16:15
Plays audio from mic over speaker
import pyaudio
import wave
import sys
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 44100
def main():
@sudofox
sudofox / subway_coupons.csv
Last active August 29, 2024 17:45
Subway tends to reuse the same coupon codes or active/deactivate them depending on promotional periods. So I've started collecting them.
code function
6INCHMEAL649 Get a 6" Meal for $6.49
6SUB Get a 6" Sub for $3.99
899MEAL Get a Footlong Meal for $8.99
BEVERAGE FREE Small Fountain Drink when you buy a Footlong
BOGO50 BOGO 50% off Any Footlong
CHIPSFL FREE Bag of Chips when you buy a Footlong
FL1299 Get TWO Footlongs for $12.99
FL1799 Get THREE Footlongs for $17.99
FL699 Get a Footlong for $6.99
@sudofox
sudofox / README.md
Created March 9, 2023 20:36
this will generate a list of <first 8 chars of sha1 hash of IP>:<IP> mappings.

This will generate a list of <first 8 chars of sha1 hash of IP>: mappings. once sorted, a sorted binary search tool like sgrep can be used to search for sha1-hashed IPs.

I wrote this for some testing of sudofox/mojang-blacklist. unfortunately it does still use like 94 GB of disk space to store the file and it takes a long while to sort that file once it's been generated.

@sudofox
sudofox / dialtone.html
Created January 3, 2023 20:37
US/NANP Precise Tone Plan compliant dial tone generator (html)
<!DOCTYPE html>
<html>
<head>
<title>Dial Tone Generator</title>
</head>
<body>
<button id="startButton">Start</button>
<button id="stopButton">Stop</button>
<script>
const startButton = document.getElementById("startButton");
@sudofox
sudofox / bluebox.html
Last active January 3, 2023 16:33
simple blue box in html/js, not thoroughly tested
<html>
<head>
<script>
function playTones(frequencies) {
// Create an audio context
var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
// Create an oscillator for each frequency
var oscillators = frequencies.map(function(frequency) {
var oscillator = audioCtx.createOscillator();
@sudofox
sudofox / perl_hashref_array_filter.pl
Created November 30, 2022 18:40
filter an array of hashrefs for only the fields i want
# as function
sub filter { my $fields = shift; my @results = @_; foreach my $result (@results) { my $replacement = {}; foreach my $field (@$fields) { $replacement->{$field} = $result->{$field}; } $result = $replacement; } return @results; }
# as anonymous func
my $filter = sub {my $fields = shift; my @results = @_; foreach my $result (@results) {my $replacement = {}; foreach my $field (@$fields) {$replacement->{$field} = $result->{$field};} $result = $replacement;} return @results;};
# usages
my @results = $filter->([qw/metadata uuid/], $object->attribute->asHashRefs);
my @results = filter([qw/metadata uuid/], $object->attribute->asHashRefs);
<?php
class Solution {
/**
* @param Integer[] $nums
* @param Integer $target
* @return Integer[]
*/
function twoSum($nums, $target) {