Skip to content

Instantly share code, notes, and snippets.

@llllvvuu
llllvvuu / requirements.txt
Last active April 11, 2024 08:14
Salt pdf form fields to prevent collision when merging with another pdf. Tested with Python 3.9.18.
PyPDF2==3.0.1

Problem: https://twitter.com/littmath/status/1769044719034647001

Flip a fair coin 100 times—it gives a sequence of heads (H) and tails (T). For each HH in the sequence of flips, Alice gets a point; for each HT, Bob does, so e.g. for the sequence THHHT Alice gets 2 points and Bob gets 1 point. Who is most likely to win?

Proofs:

  1. https://twitter.com/llllvvuu/status/1769629337953923403
  2. https://x.com/alexselby1770/status/1769795987344638033
  3. https://twitter.com/RadishHarmers/status/1770217473716932647
  4. https://x.com/RadishHarmers/status/1771368007174168604?s=20

Keybase proof

I hereby claim:

  • I am llllvvuu on github.
  • I am llwu (https://keybase.io/llwu) on keybase.
  • I have a public key ASBegEzHvChNWe569jBMgHkkJPAmA7La4nhxghUB4gEdZgo

To claim this, I am signing this object:

@llllvvuu
llllvvuu / screenshot.sh
Created April 12, 2017 22:51
command line script to grab frames from video files with .ass subs using fast seek
infile=$1
shift
outfile=$1
shift
ffmpeg -dump_attachment:t "" -i "$infile"
mv *.ttf *.TTF *.otf *.OTF *.ttc *.TTC ~/.fonts
fc-cache -fv ~/.fonts
ffmpeg -i "$infile" -map 0:s:0 subs.ass
for var in "$@"
do
@llllvvuu
llllvvuu / mouse.xboxdrv
Created January 7, 2017 11:58
OSMC RasPi Wireless XBox 360 controller
# Mouse Emulation
# ===============
#
# This configuration file emulates a mouse. The left stick controls
# the cursor, the right stick becomes a horizontal and vertical scroll
# wheel, the dpad acts as cursor keys, the start and back buttons
# become forward and back buttons, the guide button escape and LB and
# RB become page up and page down and the face button act as mouse
# button.