Skip to content

Instantly share code, notes, and snippets.

View freundTech's full-sized avatar
🖥️

Adrian Freund freundTech

🖥️
View GitHub Profile
@freundTech
freundTech / multilookup.py
Created July 12, 2016 17:26
Hangoutsbot lookup plugin supporting multiple tables
import logging
import hangups
from utils import unicode_to_ascii
import urllib.request
import plugins
logger = logging.getLogger(__name__)
@freundTech
freundTech / pokemon.py
Last active July 15, 2016 13:50
German pokedex hangoutsbot
'''
pokemon.py -- a hangoutsbot plugin for retrieving information about pokemon, given a name
This uses the pokeapi.co API to retrieve the information.
Because Pokéapi limits requests to 300 requests per method, we store cached data for each Pokémon for 5 days - this should be sufficient for up to 1500 Pokémon overall. Currently there are approximately 811 Pokémon accessible through the Pokéapi so this should be more than enough.
'''
import hangups, plugins, asyncio, logging, datetime
import urllib.request
import json
import aiohttp, os, io
@freundTech
freundTech / duckhunt.py
Created July 9, 2016 13:41
Hangupsbot Duckhunt
import asyncio
import re
import operator
import random
from time import time
from collections import defaultdict
from utils import remove_accents
import hangups
#!/bin/bash
keymaps=($HOME/.config/xmodswitch/layouts/*)
active=$(cat "$HOME/.config/xmodswitch/active")
for ((i=0; i<${#keymaps[@]}-1; i++))
do
if [ "`basename ${keymaps[$i]}`" == "$active" ]
then
xmodmap "${keymaps[$i+1]}"
@freundTech
freundTech / _etc_profile.d_jre.sh
Created June 12, 2016 18:26
Java Swing native look
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
@freundTech
freundTech / resize.sh
Last active July 2, 2016 19:00
Blubb-image-converter
#/bin/bash
if [ ! -d "output" ]
then
mkdir "output"
fi
if [ ! -d "output/thumb" ]
then
mkdir "output/thumb"
fi
@freundTech
freundTech / lastcall.py
Last active June 12, 2016 14:30
Small plugin for Hangoutsbot
import time
import hangups
import plugins
def _initialise(bot):
plugins.register_handler(on_hangout_call, type="call")
plugins.register_user_command(["callstats"])
def on_hangout_call(bot, event, command):
@freundTech
freundTech / keybase.md
Created January 6, 2016 10:36
keybase.md

Keybase proof

I hereby claim:

  • I am freundTech on github.
  • I am freundtech (https://keybase.io/freundtech) on keybase.
  • I have a public key whose fingerprint is 8BC3 78A9 428E 04D3 6A0D 99FF FA67 417B 5F28 901C

To claim this, I am signing this object:

@freundTech
freundTech / game.a51
Last active February 3, 2016 06:42
A small game for 8051 processors. Requires 8 LEDs on Port 1 and 8 buttons on both Port 0 and Port 2.
counter equ 0x20
timer1 equ 0x21
timer2 equ 0x22
timer3 equ 0x23
points1 equ 0x24
points2 equ 0x25
input1 equ P2
input2 equ P0
output equ P1
@freundTech
freundTech / js-horror.js
Last active January 24, 2020 22:21
Possibly the worst JavaScript ever written
this[([]+!![])[!![]+!![]+!![]]+"v"+([]+![])[![]+!![]]+([]+![])[!![]+!![]]](([]+![])[![]+![]]+([]+[][[]])[![]+![]]+([]+[][[]])[![]+!![]]+([]+typeof([]))[!![]+!![]+!![]+!![]]+([]+!![])[![]+![]]+([]+[][[]])[!![]+!![]+!![]+!![]+!![]]+([]+typeof([]))[![]+![]]+([]+[][[]])[![]+!![]]+" "+([]+![])[![]+!![]]+([]+!![])[![]+!![]]+([]+!![])[![]+!![]]+([]+![])[![]+!![]]+"y"+([]+[][[]])[!![]+!![]+!![]+!![]+!![]]+([]+![])[![]+![]]+"y"+"("+([]+!![])[![]+![]]+")"+"{"+"v"+([]+![])[![]+!![]]+([]+!![])[![]+!![]]+" "+([]+typeof([]))[![]+![]]+"="+"{"+([]+![])[![]+!![]]+":"+"\""+"("+"["+"]"+"+"+"!"+"["+"]"+")"+"["+"!"+"["+"]"+"+"+"!"+"!"+"["+"]"+"]"+"\""+","+(typeof(![]))[![]+![]]+":"+"\""+"("+([]+!![])[![]+![]]+"y"+"p"+([]+!![])[!![]+!![]+!![]]+([]+typeof([]))[![]+![]]+([]+![])[![]+![]]+"("+"!"+"["+"]"+")"+")"+"["+"!"+"["+"]"+"+"+"!"+"["+"]"+"]"+"\""+","+([]+typeof([]))[!![]+!![]+!![]+!![]]+":"+"\""+"("+"["+"]"+"+"+([]+!![])[![]+![]]+"y"+"p"+([]+!![])[!![]+!![]+!![]]+([]+typeof([]))[![]+![]]+([]+![])[![]+![]]+"("+"["+"]"+")"+")"+"[