Skip to content

Instantly share code, notes, and snippets.

@mcpower
mcpower / aoc-tips.md
Last active March 27, 2024 03:28
Tips for getting on the Advent of Code leaderboard

Hi, I'm mcpower. I've done Advent of Code seriously for two years now in Python, placing 9th in 2018 and 12th in 2017. This year, I'm taking a break from aiming for the leaderboard - while it's fun and all, it is a bit stressful at times (the good kind of stress, though!). As such, I'd like to share a few tips for anyone wanting to aim for the leaderboard.

This is everything that worked for me. Your mileage may vary, though - don't take this as gospel, see what works for you.

Go fast

Go fast.

Keybase proof

I hereby claim:

  • I am mcpower on github.
  • I am mcpower (https://keybase.io/mcpower) on keybase.
  • I have a public key ASAP9e2zkiWgreVGbhxKp_i0PWAi0Tn1lqS6B__Dbpzlfgo

To claim this, I am signing this object:

@mcpower
mcpower / !toss.md
Created March 28, 2019 12:40 — forked from mossbanay/bot.py

WHO GIVES A TOSS?

The rules of the game are as follows:

  • We play a total of N_GAMES times
  • In each game, there are N_TOSSES made
  • You can choose to bet on any of those tosses
  • You are given the odds (which are constant for each game) before starting
  • You are given your starting money before starting
  • Each game a new probability of the coin landing heads is chosen from some distribution within [0, 1] (see judge.py)
  • The probability is constant for each game
@mcpower
mcpower / aoc-2018.css
Last active November 28, 2019 21:28 — forked from lynn/aoc-2018.css
My user stylesheet for Advent of Code
/* Sans-serif for most content. */
body { font-family: "Ubuntu", "Segoe UI", sans-serif; line-height: 1.3em; }
input~span:before, .leaderboard-entry, .privboard-row { font-family: "Source Code Pro", monospace; letter-spacing: -1px; }
/* Emphasis = bold, instead of glowy. */
body * { text-shadow: none !important; }
article em { font-weight: bold; }
/* Center content. */
main>article, main>p, pre.calendar, pre.stats, form, .leaderboard-entry, header { width: 40em !important; margin-left: auto; margin-right: auto; }
cloudprint
googleplus
docs
drive
fitness
keep
newswidget
books
playgames
movies
@mcpower
mcpower / dynasty_preloader.user.js
Last active January 9, 2017 12:05
Dynasty Preloader
// ==UserScript==
// @name Dynasty Preloader
// @namespace http://tampermonkey.net/
// @version 0.3.5.1
// @description Preloads Dynasty Reader pages.
// @author mcpower
// @match http://dynasty-scans.com/chapters/*
// @grant none
// @license GPLv3
// ==/UserScript==
diff -ur old/extractwifi.c new/extractwifi.c
--- old/extractwifi.c 2016-12-29 23:04:40.000000000 +1100
+++ new/extractwifi.c 2016-12-30 16:00:29.106186400 +1100
@@ -51,7 +51,7 @@
int main(int argc, char** argv) {
if(argc<2) {
printf("Usage:\n");
- printf("./extractwifi filename\n");
+ printf("./extractwifi filename [offset=b730]\n");
return -1;
@mcpower
mcpower / fix.ps1
Created October 2, 2016 09:42
Fixing broken Windows 10 apps
Add-AppxPackage -DisableDevelopmentMode "$env:windir\systemapps\ContactSupport_cw5n1h2txyewy\appxmanifest.xml" -Register
Add-AppxPackage -DisableDevelopmentMode "$env:windir\systemapps\Microsoft.AAD.BrokerPlugin_cw5n1h2txyewy\appxmanifest.xml" -Register
Add-AppxPackage -DisableDevelopmentMode "$env:windir\systemapps\Microsoft.AccountsControl_cw5n1h2txyewy\appxmanifest.xml" -Register
Add-AppxPackage -DisableDevelopmentMode "$env:windir\systemapps\Microsoft.BioEnrollment_cw5n1h2txyewy\appxmanifest.xml" -Register
Add-AppxPackage -DisableDevelopmentMode "$env:windir\systemapps\Microsoft.LockApp_cw5n1h2txyewy\appxmanifest.xml" -Register
Add-AppxPackage -DisableDevelopmentMode "$env:windir\systemapps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\appxmanifest.xml" -Register
Add-AppxPackage -DisableDevelopmentMode "$env:windir\systemapps\Microsoft.PPIProjection_cw5n1h2txyewy\appxmanifest.xml" -Register
Add-AppxPackage -DisableDevelopmentMode "$env:windir\systemapps\Microsoft.Windows.AppRep.ChxApp_cw5n1h2txyewy\appxmanifest.x
@mcpower
mcpower / osugame_func+.user.js
Created March 15, 2016 00:12
Userscript for /r/osugame
// ==UserScript==
// @name osugame_func+
// @namespace /r/osugame
// @author /u/N3G4
// @description Adds osu! related functionality to /r/osugame
// @include *reddit.com/r/osugame*
// @version 1.2.2
// @run-at document-end
// @grant GM_xmlhttpRequest
// ==/UserScript==
#Hotstring EndChars :
#Hotstring O ?
:::+1::👍
:::-1::👎
:::100::💯
:::1234::🔢
:::8ball::🎱
:::a::🅰️
:::ab::🆎
:::abc::🔤