Skip to content

Instantly share code, notes, and snippets.

View jkmartindale's full-sized avatar
:shipit:
Procrastinating

James Martindale jkmartindale

:shipit:
Procrastinating
View GitHub Profile
@jkmartindale
jkmartindale / arcade.py
Created August 26, 2024 03:38
GTA Arcade T-Shirt Optimization
import itertools
prices = [
2135000,
1875000,
2345000,
1565000,
1235000,
]
@jkmartindale
jkmartindale / decrypt.py
Created March 18, 2024 07:40
Decrypt Hulu SAMI (.smi) subtitles
# Don't use this, just grab WebVTT subtitles instead loool
# This was just how I spent a lazy Sunday evening
from Crypto.Cipher import AES
from Crypto.Util import Padding
import binascii
import glob
import os
from xml.etree import ElementTree
<?xml version="1.0"?>
<!DOCTYPE lol [
<!ELEMENT lol ((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
@jkmartindale
jkmartindale / awa-twitch.js
Last active October 30, 2024 00:21
Paste this into your browser console to hopefully start earning rewards. Forum thread: https://web.archive.org/web/20230922092451/https%3A%2F%2Fna.alienwarearena.com%2Fucf%2Fshow%2F2167631
/* Twitch Quest Fixer v3.1 */
const extensionID = "ehc5ey5g9hoehi8ys54lr6eknomqgr";
const channel = location.pathname.slice(1).toLowerCase();
const channelId = __APOLLO_CLIENT__.cache.data.data.ROOT_QUERY["channel({\"name\":\""+channel+"\"})"].__ref.split(":")[1];
const pollDuration = 60000;
let authToken = __APOLLO_CLIENT__.cache.data.data["Channel:" + channelId].selfInstalledExtensions.filter(x => x.helixToken.extensionID == extensionID)[0].token.jwt;
grantPermission = async () => {
console.log("Attempting to grant permission automatically...");
const integrityResponse = await (await fetch("https://gql.twitch.tv/integrity", { method: "post", headers: commonOptions.headers })).json();
@jkmartindale
jkmartindale / recurring-tasks.js
Created July 21, 2022 00:02
"Show" formula for a Notion-backed recurring task system
(or(prop("Pinned"), largerEq(floor((timestamp(now()) + toNumber(slice(formatDate(now(), "ZZ"), 0, 3)) * 3.6e+6 + toNumber(replace(formatDate(now(), "Z"), "\\d{2}:", "")) * 60000) / 8.64e+7) - floor((timestamp(prop("Edited")) + toNumber(slice(formatDate(now(), "ZZ"), 0, 3)) * 3.6e+6 + toNumber(replace(formatDate(now(), "Z"), "\\d{2}:", "")) * 60000) / 8.64e+7), if(empty(prop("n Days")), 1, prop("n Days"))) and or(empty(prop("Days of Week")), contains(prop("Days of Week"), formatDate(now(), "ddd"))) and or(empty(prop("Day of Month")), date(now()) == prop("Day of Month"))) or prop("Edited") < prop("Start Date")) and (now() > prop("Start Date") or empty(prop("Start Date")))
// The above but slightly more readable
(
or(
prop("Pinned"), // Force display if pinned
largerEq( // Show task if it has been more than n days since edit time
// but we round down to midnight and adjust for time zone
floor((timestamp(now()) + toNumber(slice(formatDate(now(), "ZZ"), 0, 3)) * 3.6e+6 + toNumber(replace(for
"""Sitemap redirect checker
Scans a sitemap to list three groups of URLs:
- Insecure redirects (same or different origin)
- Secure external redirects (safe and typically out of scope)
- Regular URLs (same origin, redirects resolved, in scope)
"""
from bs4 import BeautifulSoup
import progressbar
@jkmartindale
jkmartindale / closure-compiler-angy.js
Created September 9, 2021 19:37
Browser console snippet that Closure Compiler expands to larger than the original size, even in whitespace only mode
[...document.querySelectorAll('script[src]')].sort((x,y) => {
let splitx = x.src.split('/');
let splity = y.src.split('/');
return splitx[splitx.length-1].localeCompare(splity[splity.length-1])
}).map(x=>console.log(x.src))
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken
@jkmartindale
jkmartindale / championflow-revised.js
Last active September 3, 2022 18:01
Bypass that annoying as hell, buggy task verification gate
let user = JSON.parse(localStorage.getItem('user'));
user.giveaways[user.giveaways.length-1].tasks.forEach(task => task.completed = '1');
localStorage.setItem('user', JSON.stringify(user));
refreshInterface();