Skip to content

Instantly share code, notes, and snippets.

@boppreh
boppreh / balloontip.py
Created November 2, 2012 11:35 — forked from wontoncc/balloontip.py
Balloon tip module, Python, using win32gui. Display a notification in the tray bar and quits after 10 seconds.
# -- coding: utf-8 --
from win32api import *
from win32gui import *
import win32con
import sys, os
import struct
import time
class WindowsBalloonTip:
@boppreh
boppreh / keyboard.js
Created May 4, 2015 21:47
Allow keyboard control in agar.io
var oldOnKeyDown = window.onkeydown
var canvas = document.getElementById('canvas');
var oldMouseMove = canvas.onmousemove
canvas.onmousemove = null;
var pressedKeys = {}
window.onkeydown = function (f) {
pressedKeys[f.keyCode] = 1;
oldOnKeyDown(f);
updateKey();
@boppreh
boppreh / recorder.py
Created May 2, 2016 03:02
Keyboard recorder for screencasts
import sys
import keyboard
import pickle
import os
if len(sys.argv) == 1:
filename = input('Input filename to save/load events: ')
else:
filename = sys.argv[1]
@boppreh
boppreh / radar.js
Created January 10, 2018 19:15
Script for airma.sh to help aim. Moves enemies' flags to around you, like a radar, and their position compensates for leading time/distance. May have to change "mult" to suit your plane/upgrades.
let me = Players.getMe();
let mult = 1000;
(function(updateNameplate) {
me.__proto__.updateNameplate = function() {
let ret = updateNameplate.apply(this, arguments);
this.sprites.flag.scale.set(0.2, 0.2);
if (this == me) {
this.sprites.flag.position.set(me.pos.x, me.pos.y);
return ret;
}
golden_ratio = 0x9E3779B9
max_int = 2**32 - 1
def rotate_left_5(value):
return ((value << 5) | (value >> 27)) & max_int
def add_to_hash(hash_value, value):
return (golden_ratio * (rotate_left_5(hash_value) ^ value)) & max_int
def hash_simple(url):

Keybase proof

I hereby claim:

  • I am boppreh on github.
  • I am boppreh (https://keybase.io/boppreh) on keybase.
  • I have a public key ASBSbxSUYkYsfpiSezT6HRL-HaEFI6Zla-g5rH8sYtEFWAo

To claim this, I am signing this object:

const 𝗫 = 1;
const 𝖷 = 0;
x = list => list.length
Array.prototype.ꭓ = Array.prototype.reduce
Array.prototype.ჯ = Array.prototype.slice
Array.prototype.X = Array.prototype.push
𝚇 = (𝕏) => {
𝚾 = []
def make(goal, book, pantry, costs):
def guess(steps, required_ingredients):
if all(pantry.count(ingredient) >= required_ingredients.count(ingredient) for ingredient in required_ingredients):
yield tuple(sorted(required_ingredients)), steps
for ingredient in set(required_ingredients) & set(book):
new_required_ingredients = required_ingredients + book[ingredient]
new_required_ingredients.remove(ingredient)
yield from guess([ingredient] + steps, new_required_ingredients)
yield from guess([goal], book[goal])
@boppreh
boppreh / ipconfig_parser.py
Created November 17, 2021 12:47
Parse `ipconfig /all` in Python
import subprocess
import collections
Interface = collections.namedtuple('Interface', 'name description subnet_mask ipv4_addresses ipv4_gateway ipv6_addresses ipv6_gateway dhcp_server dns_servers')
def parse_ipconfig():
"""
Parses results from ipconfig. PowerShell has more structured functions, but
they don't serialize properly
(https://stackoverflow.com/questions/69997138/serialization-differences-between-powershells-format-list-and-convertto-json).
@boppreh
boppreh / userContent.css
Created May 17, 2022 19:49
Give a grey title to visited Youtube links based on browser history, without enabling watch history
# Save to C:\Users\{USER}\AppData\Roaming\Mozilla\Firefox\Profiles\{PROFILE_NAME}\chrome\userContent.css
# And enable "toolkit.legacyUserProfileCustomizations.stylesheets" on about:config
@-moz-document domain(www.youtube.com)
{
a:visited {
color: grey !important;
}
}