Skip to content

Instantly share code, notes, and snippets.

@Z1ni
Z1ni / np-enhancer.user.js
Last active August 29, 2015 14:06
Naamapalmu Enhancer
// ==UserScript==
// @name Naamapalmu Enhancer
// @namespace NPEnhancer
// @include http://naamapalmu.com/*
// @icon http://naamapalmu.com/favicon.ico
// @downloadUrl https://gist.github.com/Z1ni/1860115e881e5e12de26/raw/np-enhancer.user.js
// @version 1.0 indev 2
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_addStyle
@Z1ni
Z1ni / iltasaatana.user.js
Last active August 29, 2015 14:10
Iltasaatana
// ==UserScript==
// @name Iltasaatana
// @description Iltasaatana
// @include http://www.iltalehti.fi/*
// @namespace zini-iltasaatana
// @version 1.0c
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js
// @downloadURL https://gist.github.com/Z1ni/f4aff84d6fc030874169/raw/iltasaatana.user.js
// ==/UserScript==
@Z1ni
Z1ni / twitch-html5-player-enabler.user.js
Created January 15, 2016 16:10
Enables Twitch HTML5 player on channel pages
// ==UserScript==
// @name Twitch HTML5 player enabler
// @namespace im.zini.twitch_html5_enabler
// @include http://www.twitch.tv/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js
// @grant none
// @run-at document-idle
// @version 1.0
// ==/UserScript==
@Z1ni
Z1ni / hangman.c
Created April 27, 2016 23:06
Hangman written in ANSI C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
Simple Hangman Game written in ANSI C
Copyright © 2016 zini <zini.fin@gmail.com>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
@Z1ni
Z1ni / uta_course_info.py
Last active September 11, 2016 00:25
Parses information about CS courses at University of Tampere
#!/usr/bin/python3
import requests
import re
import time
import json
from argparse import ArgumentParser
from bs4 import BeautifulSoup as bs4
from datetime import datetime as dt
from datetime import timedelta
function getMatchIDs() {
var ids = [];
var a_tags = document.getElementsByClassName("covMainBoxContent")[0].getElementsByTagName("a");
for (var i = 0; i < a_tags.length; i++) {
var tag = a_tags[i];
if (tag.href.indexOf("matchid") > -1) {
var matchId = parseInt(tag.href.split(/matchid=/)[1]);
ids.push(matchId);
}
}
@Z1ni
Z1ni / mattermost_santa.js
Last active December 12, 2018 13:03
Mattermost Santa hats
// Mattermost Santa hats
// ===============================================================================
// This script gives every Mattermost avatar a Santa hat (only browser version).
// Message display setting needs to be Standard, as Compact doesn't have avatars.
// Enable by pasting the code to the browser console while on Mattermost.
// Tested with Chrome and Firefox.
// Vanilla
new MutationObserver((mutList, observer) =>
[...mutList
@Z1ni
Z1ni / server_online_check.py
Last active March 13, 2021 01:29
Valheim / Valve Game Networking Sockets server online checker
#!/usr/bin/env python3
# Valheim/Valve Game Networking Sockets server online checker
# Zini, 2021
# Usage:
# ./server_online_check.py hostname_or_ip port
# Hostname defaults to localhost, port defaults to 2456
import socket
@Z1ni
Z1ni / yakuza_save_convert.py
Created March 21, 2021 20:55
Yakuza save game "converter" for Xbox Game Pass for PC
import os
import struct
import sys
import uuid
import zipfile
# Yakuza 0 save "converter" (Xbox Game Pass for PC -> Steam)
# Might work for other Yakuza games available with the Game Pass if the app name is changed.
# Running: Just run the script with Python 3 to create a ZIP file that contains the save files