Skip to content

Instantly share code, notes, and snippets.

View mozurin's full-sized avatar

mouzrin mozurin

View GitHub Profile
// ==UserScript==
// @name PenpaSolvedWidget
// @namespace https://dislife.com/
// @version 0.0.4
// @description Add solved markers to Pazupure or Puzz.link problem links.
// @author mozurin
// @match *://*/*
// @noframes
// @require https://cdnjs.cloudflare.com/ajax/libs/js-sha1/0.6.0/sha1.min.js
// @grant GM.getValue
@mozurin
mozurin / HashitakaSolved.user.js
Last active July 10, 2022 12:10
Add solved markers to Hashitaka's puzzle links.
// ChangeLog:
// 0.2.1 Add rough English translation.
// 0.2.0 Add new feature that overwrites page title of game player tab by
// referred link name.
//
// ChangeLog.ja:
// 0.2.1 雑な英語翻訳を追加
// 0.2.0 ゲーム画面タブのタイトルをリンク元のリンク名で書き換える機能を追加
//
// ==UserScript==
@mozurin
mozurin / trip.py
Created March 22, 2021 18:00
5ch (2ch) trip calculator snippet.
# 5ch (2ch) trip calculator snippet
import re
import base64
import hashlib
from passlib.hash import des_crypt
DEFAULT_CHARSET = 'ms932'
@mozurin
mozurin / rasterizepdf.sh
Created January 5, 2021 04:11
Rasterize PDF files with Ghostscript and ImageMagick.
#!/bin/sh
# Rasterize PDF files with Ghostscript and ImageMagick.
set -e
# parse options
DENSITY='600'
ADDEXT='.raster'
@mozurin
mozurin / twitter_video_extractor.user.js
Last active December 28, 2020 06:56
Tampermonkey script that extracts hi-res MP4 movie file URLs from tweet permalink page.
// ==UserScript==
// @name Twitter video extractor
// @namespace https://dislife.com/
// @version 0.0.3
// @description Extract hi-res MP4 movie file URLs from tweet permalink page
// @author mizuki@mozurin.com
// @match https://twitter.com/*/status/*
// @grant none
// @run-at document-body
// ==/UserScript==
# Python WM_KEYDOWN / WM_KEYUP message checker based on following CreateWindow
# example gist:
# https://gist.github.com/mouseroot/6128651
# (I lost my Spy++ binary...)
from ctypes import *
from ctypes.wintypes import *
WNDPROCTYPE = WINFUNCTYPE(c_int, HWND, c_uint, WPARAM, LPARAM)
@mozurin
mozurin / expruino-tetris.js
Created November 30, 2020 09:27
Simple tetris game for Pixl.js board
/**
* Simple tetris game for Pixl.js board
*/
// rotate right
g.setRotation(1);
// turn on backlight
LED1.write(1);
@mozurin
mozurin / libserialport-0.dll
Last active May 24, 2018 12:49
Find USB CDC based serial port by its USB serial number
@mozurin
mozurin / shift_exif_timezone.py
Last active April 16, 2018 01:37
Convert local timestamps in Exif to UTC timestamps
'''
shift_exif_timezone.py - Convert local timestamps in Exif to UTC timestamps
Timestamps in Exif records are not timezone-aware. They are naive format. So
there will be protocol mismatch; some camera writes "local" timestamp in Exif,
but some software recognizes it as "UTC" on the other hand. To resolve the
situation, this snippet converts timestamps in '0th' and 'Exif' IFD to UTC
timestamps.
Note: GPS always uses UTC timestamps, so timestamps in 'GPS' IFD are not