Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sli
sli / ips.py
Last active January 9, 2024 22:41
Python IPS patcher.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# IPS Patcher
# Copyright (©) itari 2014
# Do whatever you want with this, I don't care. :D
#
# Modified by sli to work on the command line and with
# Python 3. Who even uses Tkinter anymore?
@sli
sli / jiggler.rs
Last active November 27, 2023 07:39
Mouse jiggler for an rp2040
#![no_std]
#![no_main]
use adafruit_kb2040 as bsp;
use defmt_rtt as _;
use panic_halt as _;
use bsp::{
entry, hal,
@sli
sli / grid.lua
Created February 17, 2013 04:10
LOVE2D Grid Selection With A*
-- rounds a number to the nearest multiple of cell_size
-- for determining a cell in the grid
function grid_coords(n)
return math.floor(n / cell_size) * cell_size;
end
function love.conf(t)
t.title = "Worldthing"
t.author = "sli"
t.modules.physics = false
@sli
sli / install-chatterino.sh
Last active May 15, 2022 23:46
Automated Chatterino install.
#!/bin/bash
# This script adapted from the compilation guide here:
# https://github.com/Chatterino/chatterino2/blob/master/BUILDING_ON_LINUX.md
# Install dependencies, including a library required on RasPi/ARM Linux that is
# not listed in the compilation docs (libatomic)
sudo apt install -y qttools5-dev qtmultimedia5-dev libqt5svg5-dev libboost-dev \
libssl-dev libboost-system-dev libboost-filesystem-dev cmake g++ \
libatomic-ops-dev
@sli
sli / demon.py
Created December 31, 2010 23:16
Demon-playing Python script.
import random
class Card:
def __init__(self, name, value, suit):
self.name = name
self.value = value
self.suit = suit
def __str__(self):
return '%s%s' % (self.name, self.suit[0])
@sli
sli / MatricomManual.md
Last active July 3, 2021 22:22
Transcribed manual for Matricom GPad controllers.

Matricom Gamepad

For your enjoyment and safety, we recommend that you read this manual thoroughly before using this product and keep this manual handy for reference if needed.

Characteristics:

  1. Compatible with Android and PC
  2. Wireless
  3. D-Pad and 12 buttons
  4. Dual analog joysticks
@sli
sli / block-sprites.css
Created October 28, 2011 02:34
Minecraft item/block CSS sprites (1.0)
/* Uses this image: http://dl.dropbox.com/u/5768678/minecraft-sprites/blocks.png */
.block {
background-image: url('blocks.png');
width: 32px;
height: 32px;
}
#cobblestone { background-position: 0px 0px; }
#stone-bricks-1 { background-position: 0px -32px; }
#lapis-lazuli-block { background-position: 0px -64px; }
@sli
sli / hexmap.py
Created November 24, 2011 22:14
Hexmap Generator (PyGame)
import sys
import pygame
from pygame.locals import *
##### Rendering Fuctions #####
def drawGrid(context, width, height, cell_size):
column = 1
row = 0
at = 0
@sli
sli / autoid.py
Last active January 22, 2020 22:17
Auto ID and auto ghost addon for HexChat. Should be portable enough to work on any IRC network.
import hexchat
from time import sleep
__module_name__ = 'AutoID'
__module_version__ = '0.1'
__module_description__ = 'Auto identify or ghost when nickname services requests it.'
def display_conf():
hexchat.prnt('[AutoID] Current AutoID settings:')
n = hexchat.get_pluginpref('nick') or hexchat.get_prefs('irc_nick1')
@sli
sli / gitlab-firacode.user.js
Last active December 6, 2019 18:35
A userscript to enable ligatures (using Fira Code) on <code> blocks and Monaco Editors.
// ==UserScript==
// @name Browser Fira Code
// @version 1
// @grant none
// ==/UserScript==
const GM_addCssResource = href => {
const head = document.getElementsByTagName('head')[0]
if (!head) { return }