Skip to content

Instantly share code, notes, and snippets.

loc_1FD4E:
lea (Player_1).w,a1 ; player = player 1
move.w $30(self),d1 ; vel_x = self.$30
move.w d6,d0 ;
andi.w #1,d0 ;
beq.w check_player2 ; check player 2 collisions if player 1 is not colliding
tst.b (self+subtype) ;
bpl.s subtype_nonzero ; if (subtype != 0) goto loc
@drx
drx / pinerrors.py
Created May 16, 2017 01:10
Detect EPROM errors
import sys
import math
from collections import defaultdict
def inner_addresses(pin):
for i in range(2**pin):
yield i
def outer_addresses(pin, rom_size):
gap = 2**(pin+1)
@drx
drx / todo.md
Created October 26, 2016 00:43
romkit todo

romkit todo

$ rom [file.bin ...]

If invoked with no options, implies --all.

$ rom -a, --all

Implies --type --meta --info --header --list 30 --error --deep_scan.

--

@drx
drx / bib-change-tracker.py
Created January 23, 2016 15:22
Add 'bibliotik.me' tracker to bibliotik torrents in Transmission Daemon
from transmission import Transmission
# configure these two lines
new_tracker = 'https://bibliotik.me/announce.php?passkey=XXX' # insert your own passkey
client = Transmission(host='localhost', port=9091, username='user', password='password') # change to your details
response = client('torrent-get', ids=range(1,10000), fields=['id', 'name', 'hashString', 'trackers'])
bib_ids = []
@drx
drx / TV Shows.md
Last active March 18, 2018 21:54
Recommended TV Shows (loosely ordered by strength of recommendation)

Must see

  • The Wire
  • Firefly (and Serenity)
  • South Park
  • Buffy (crosses over with Angel from Season 4)
  • Sherlock

Recommended

(shows I recommend without hesitation)

import networkx as nx
board = [
[6, 3, 5, 6, 5, 3, 6],
[3, 4, 4, 3, 4, 5, 5],
[4, 5, 3, 2, 3, 4, 6],
[5, 4, 3, 0, 4, 3, 3],
[3, 5, 4, 4, 3, 3, 3],
[3, 4, 3, 1, 3, 3, 2],
[2, 2, 3, 5, 1, 3, 5],
Index Variant Major area, region, country or area Notes Country code 2010 2011 2012 2013
1 No change WORLD 900 6916100 6998824 7082247 7166142
2 No change More developed regions a 901 1240918 1242969 1243631 1243238
3 No change Less developed regions b 902 5675182 5755855 5838616 5922905
4 No change Least developed countries c 941 838802 859574 881456 904311
5 No change Less developed regions, excluding least developed countries d 934 4836379 4896281 4957160 5018594
6 No change Less developed regions, excluding China 948 4284630 4356687 4430899 4506877
7 No change Sub-Saharan Africa e 947 831440 854050 877337 901314
8 No change AFRICA 903 1031060 1057324 1084422 1112331
9 No change Eastern Africa 910 342595 352496 362763 373389
@drx
drx / imap-bot.py
Created August 12, 2012 10:32
A small IMAP bot that searches for orders recently marked as done in an IMAP mailbox and marks them as done in Satchmo
import imaplib
import re
from django.conf import settings
from django.core.cache import cache
def get_recent_done_orders():
try:
orders = []
words = open('/usr/share/dict/words', 'r').read().split('\n')
i = 0
for word in sorted(words, key=lambda word: len(word), reverse=True):
if all(map(lambda l: l in 'qwertasdfzxcv', word)):
print word,
i += 1
if i >= 100:
print '\n'
break
@drx
drx / mbp.py
Created June 12, 2012 13:42
Tiny script to scrape Apple Online Store every second and check for changes in MacBook availability
import urllib2
import re
import time
import pycurl
import StringIO
#url = "http://78.10.81.103:19100/mbp.html"
url = "http://store.apple.com/pl/browse/home/shop_mac/family/macbook_pro/select"
prev_delivery = (None, None)