Skip to content

Instantly share code, notes, and snippets.

View mtimkovich's full-sized avatar
🐢

Max Timkovich mtimkovich

🐢
View GitHub Profile
@mtimkovich
mtimkovich / full_moon_sabbath.py
Last active February 20, 2024 19:12
"Aw man, Tray, look up at the sky. It's a full moon. On the Sabbath." -Werewolf Bar Mitzvah
from datetime import date, timedelta
# http://www.voidware.com/moon_phase.htm
def moon_phase(y, m, d):
"""
0 => new moon
1 => waxing crescent
2 => first quarter
3 => waxing gibbous
4 => full moon
@mtimkovich
mtimkovich / SpongeBobCase.ahk
Created February 4, 2024 00:13
tYpE lIkE tHiS
Random, upper, 0, 1
ToggleCase(c) {
global upper := !upper
if upper {
StringUpper, c, c
} else {
StringLower, c, c
}
use std::collections::HashMap;
use std::env;
use std::fs::File;
use std::io::{self, prelude::*, BufReader};
use std::process;
fn tokenize(letters: &str) -> HashMap<char, u8> {
let mut map = HashMap::new();
for c in letters.chars() {
*map.entry(c).or_default() += 1;
#!/usr/bin/env python
from collections import Counter
import fileinput
counter = Counter()
for line in fileinput.input():
counter.update(c for c in set(line) if c.isalpha())
print(counter)
@mtimkovich
mtimkovich / font_letter_check.txt
Created April 6, 2021 22:42 — forked from marcospedreiro/font_letter_check.txt
/u/martinus test pattern to check how distingushable characters are for a font
From: https://www.reddit.com/r/programming/comments/8jjq33/11_best_programming_fonts/dz0xxs5/
------
o0O s5S z2Z !|l1Iij {([|})] .,;: ``''""
a@#* vVuUwW <>;^°=-~ öÖüÜäÄßµ \/\/
the quick brown fox jumps over the lazy dog
THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
0123456789 &-+@ for (int i=0; i<j; ++i) { }
@mtimkovich
mtimkovich / MuteMic.ahk
Last active March 24, 2021 19:10
Keyboard shortcut to mute the mic.
; https://www.autohotkey.com/docs/commands/SoundSet.htm#Ex
F13::
MIC_ID = 7
SoundSet, +1, MASTER, mute, %MIC_ID%
SoundGet, master_mute, , mute, %MIC_ID%
Msg := "Microphone online"
Action := "Insert"
@mtimkovich
mtimkovich / ping_test.py
Created January 12, 2021 03:08
Test if our ping is good enough to play Rocket League
import platform
import re
import subprocess
from statistics import mean
def pings(*, url='google.com', count=10):
if platform.system() == 'Windows':
flag = '-n'
else:
flag = '-c'
@mtimkovich
mtimkovich / im_uninstalling.ps1
Created December 27, 2020 09:19
Script to uninstall Rocket League
$rl = Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 252950"
$uninstall = $rl.UninstallString.Replace('"', '')
Invoke-Expression $uninstall
@mtimkovich
mtimkovich / take_n_percent_off_there
Created November 27, 2020 23:43
Compute "% off" calculations
import sys
import ply.lex as lex
import ply.yacc as yacc
tokens = ['NUMBER', 'MINUS', 'PERCENT']
t_ignore = ' \t'
t_MINUS = r'-'
t_PERCENT = r'%'
var PATH $PATH ~bin
function fish_prompt
echo -n $USER@(hostname) ''
set_color $fish_color_cwd
prompt_dir
set_color normal
echo -n ' $ '
end