Skip to content

Instantly share code, notes, and snippets.

View Sanqui's full-sized avatar
🦉

Sanqui Sanqui

🦉
View GitHub Profile
__module_name__ = "beep"
__module_version__ = "0.1.1"
__module_description__ = "Beeps for channel messages"
import xchat
import os
print "Beep loaded!"
# http://www.phy.mtu.edu/~suits/notefreqs.html
@Sanqui
Sanqui / README.md
Last active December 7, 2015 20:07
Setting up Let's Encrypt with nginx

The Let's Encrypt client doesn't have an automatic module for nginx yet. But don't worry, it's super easy anyway!

First of all, install letsencrypt-auto:

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt

Next, we'll run letsencrypt-auto once with no action: this will only install dependencies.

@Sanqui
Sanqui / diary.py
Created December 16, 2012 22:50
Diarykeeping for the truly lazy. (A Python module for ZNC, an IRC bouncer.)
import znc
import datetime
DAY_BEGIN_HOUR = 4
DIARY_DIR = ".diary/"
class diary(znc.Module):
description = "Diarykeeping for the truly lazy."
def OnModCommand(self, message):
@Sanqui
Sanqui / cake.py
Created January 4, 2013 10:15 — forked from kanzure/cake.py
Now supports Python 3
lines = {
11: " / ; ,-, \\_> <<_' ____________;_)",
7: " | | .--| |,~~~~~| |~~~,,,,'-| |",
3: " ( Y Y ( )",
9: " .| |~ // ___ '-',,'.",
15: " | '-._ ~~,,, ,,,~~ __.-'~ | |",
13: " | ; '-'\_\/> '-._ |",
20: " \ `'==========='` .'",
2: " ( ) ( ) (",
8: " | |-,,~~'-'___ '-' ~~| |._",
@Sanqui
Sanqui / conv_cp895.py
Created March 30, 2013 16:20
Converts file from Kamenický encoding/KEYBCS2/CP895, a legacy Czechoslovak encoding, to system Unicode. Not even iconv supports this!
#!/bin/python3
from sys import argv
highchars = 'üéďäĎŤčěĚĹÍľĺÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■'
out = ""
with open(argv[1], 'rb') as f:
for byte in f.read():
@Sanqui
Sanqui / maze.py
Last active December 16, 2015 18:29
part of a larger program
#!/bin/python
# encoding: utf-8
import random
# DIMENSIONS MUST BE ODD!
WIDTH = 17
HEIGHT = 17
SQUARE = 14
@Sanqui
Sanqui / relative_search.py
Created July 12, 2013 18:09
useful for rom hacking, i guess "optimized" for "speed"
#!/bin/pypy
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
from sys import argv
text = argv[1]
file = open(argv[2], 'rb')
@Sanqui
Sanqui / telefang.lua
Created September 20, 2013 13:40
how many telefangmons are there
colors = { black= {0, 0, 0}, red= {255, 0, 0}, white= {255, 255, 255}, green={0, 127, 0},
yellow={255,255,0}, purple={255,50,255}}
denjuunames = {
[0x0] = "Tsunonasu",
[0x1] = "Kochia",
[0x2] = "Oshe",
[0x3] = "Keshi",
[0x4] = "Crypto",
[0x5] = "Monstera",
@Sanqui
Sanqui / test.yaml
Last active December 25, 2015 10:19
yaml references example
types:
- type: &grass
name: "Grass"
advantages: []
moves:
- move: &vinewhip
power: 40
type: *grass
pokemon:
@Sanqui
Sanqui / twitchautoban.py
Last active December 26, 2015 01:19
xchat twitch auto bot ban
__module_name__ = "twitchautoban"
__module_version__ = "0.1.0"
__module_description__ = "bans twitch spambots lol"
import xchat
import os
import re
print "twitchautoban loaded!"