Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am hyper-neutrino on github.
  • I am hyperneutrino (https://keybase.io/hyperneutrino) on keybase.
  • I have a public key ASBmruFVyk3efNZLF6zH1gTk-kHS0Drp18Jtf3fKjVe29Qo

To claim this, I am signing this object:

@hyperneutrino
hyperneutrino / english-words.txt
Created August 10, 2020 20:45
3000 common english words
a
abandon
ability
able
abortion
about
above
abroad
absence
absolute
def add(x, y):
ml = max(len(str(x)), len(str(y)))
x, y = str(x).zfill(ml + 1), str(y).zfill(ml + 1)
carries = 0
z = ""
carry = 0
for a, b in zip(map(int, x[::-1]), map(int, y[::-1])):
c = a + b + carry
if c >= 10:
carries += 1
1341432011006032501307137008914209051873812477998746966275055344994508988599886516564562714154121329651463511899852562336915745037920389139440893578089283275819135159021184143490253880429705541902547033899588722346887562230193442902368628128155982700462462174170161416253100845980377174518657880702763584488582430013232439625419308753235827567654738182690661429494479780848137552142296185160742778439598391743031658697779691355794322653954937009183469442093917916749208855671510407846021524821589131648756870175776738894529769294303662100341306012818389240159817946941998121318413622528431441762768489364346212724299580887371100171301261386575588454857065648488963808407313790295796988744650262487167458533890552103502437078584895339543572811434392252611384658310333404436776806240303339308607951626708855635381032168851664800719359827126525343515726429328635392336432968097296233635851978570459446265253106851285962724496531729720731699683482991192028089905062731444600991024856709589080351583348494035403705816758165687824
@hyperneutrino
hyperneutrino / dmoj-auto-unhide.user.js
Created October 25, 2020 08:46
Userscript: automatically unhide DMOJ comments
// ==UserScript==
// @name Automatically unhide DMOJ comments
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Automatically unhide all comments with negative feedback and disable the fade mask on them
// @author HyperNeutrino
// @match https://dmoj.ca/*
// @grant none
// ==/UserScript==
(require "avl-cs145.rkt")
;; ===================================
;; We define sets using AVL trees here
;; ===================================
;; ---------
;; Variables
;; ---------
@hyperneutrino
hyperneutrino / day-10.py
Created December 10, 2020 05:26
AOC 2020 10 2
a = lines(int)
a.sort()
a.append(max(a) + 3)
b = [0] * (max(a) + 1)
b[0] = 1
for i in a:
b[i] = gi(b, i - 1) + gi(b, i - 2) + gi(b, i - 3)
mask = ""
m = {}
while True:
try: line = input()
except: break
if line[1] == "a":
mask = line[7:]
else:
a, b = map(int, line[4:].split("] = "))
b = bin(b)[2:].zfill(36)
a = [1,2,16,19,18,0]
i = [-1] * 30000001
for x,y in enumerate(a): i[y]=x
l = 0
x = len(a) + 1
while x < 30000000:
k = l
just
use
a
linkedlist
xd