Skip to content

Instantly share code, notes, and snippets.

@ali1234
ali1234 / minecrift.txt
Created October 25, 2015 16:44
Minecrift+Forge+Linux
Required files:
Minecraft.jar
forge-1.7.10-10.13.4.1448-1.7.10-installer.jar
minecrift-1.7.10-R1c-installer.jar
Steps:
1. Run Minecraft launcher: java -jar Minecraft.jar
Edit the profile and select 1.7.10. Launch the game and then exit.
@ali1234
ali1234 / makepngs.py
Created September 7, 2013 18:37
This is a quick hack to generate gradient pngs for xfwm4 themes...
#!/usr/bin/python
borders = ['bottom','bottom-left','bottom-right',
'left','right',
'title-1','title-2','title-3','title-4','title-5',
'top-left','top-right']
basecolour = '#EEEEEE'
@ali1234
ali1234 / postcode.py
Last active January 2, 2016 09:09
Tool for querying the Code-Point Open postcode dataset.
#!/usr/bin/env python
# Copyright 2014 Alistair Buxton <a.j.buxton@gmail.com>
# Build a database from the Code-Point Open postcode data and query it.
# Run ./postcode.py create to build the database from source files.
# Now with caching to speed up development.
import sqlite3
import csv
import shelve
@ali1234
ali1234 / teletextgame
Created February 29, 2016 22:23
A teletext game
#!/usr/bin/env python
# Pipe the output of this script to raspi-teletext or any teletext emulator that
# supports t42 packet streams.
#
# ./teletextgame | ./teletext -
#
# Features:
#
# * 3D graphics.
@ali1234
ali1234 / webcpl.py
Last active October 22, 2016 19:39
Python Restful Control Panel
#!/usr/bin/env python3
import http.server
import socketserver
from itertools import product
from subprocess import check_call, check_output
channels = 'ABCD'
ids = '1234'
@ali1234
ali1234 / colourswap.py
Last active March 29, 2017 23:25
Rebrickable API tool to find colour replacements
#!/usr/bin/env python
# Finds colour replacements for an LDraw file.
# Usage:
# colourswap.py <LDraw file> <colour> [<rarity>]
# colour: an LDraw colour number, eg yellow = 14
# rarity: pieces must be in at least this many sets
.SUFFIXES: .pov .png
FINAL_IMAGES=block-bg-all.png block-spec-all.png block-spec-ext.png block-mask-inverted.png
PREVIEW_IMAGES=block-preview-render.png
TEMP_IMAGES=block-mask-inverted.png
TS=128
all: $(FINAL_IMAGES) preview
dist: $(FINAL_IMAGES) dist-clean
@ali1234
ali1234 / switchingdemo.py
Created February 26, 2018 00:11
unicorn hat hd demos
import time, math, colorsys, random
from datetime import datetime, timedelta
from picamera import PiCamera
import numpy as np
import unicornhathd
unicornhathd.rotation(270)
#!/usr/bin/env python
import unicornhathd
import datetime
import numpy as np
print("""Unicorn HAT HD: Rainbow
OMG MY EYES.
Press Ctrl+C to exit!
@ali1234
ali1234 / devices.py
Last active March 4, 2018 19:54
Unified Graphics Library Yarrrrrrr
import subprocess, time, sys
import numpy as np
from PIL import Image
class GraphicsDeviceBase(object):
def __init__(self, buf, depth):
self.__buf = buf