Skip to content

Instantly share code, notes, and snippets.

View t-wy's full-sized avatar

TWY t-wy

View GitHub Profile
@t-wy
t-wy / #memorypack_unpacker.py
Last active August 28, 2025 16:05
MemoryPack unpacker in Python. Currently Incomplete for special types.
# Based on https://github.com/Cysharp/MemoryPack/blob/main/sandbox/SandboxWebApp/wwwroot/js/memorypack/MemoryPackReader.ts
# Implementation by @t-wy: https://github.com/t-wy
from typing import *
from .byte_reader import LittleEndianReader
from dataclasses import is_dataclass
from datetime import datetime
def deserialize(_type, content: bytes):
reader = LittleEndianReader(content)
@t-wy
t-wy / messagepack_csharp_unpacker.py
Last active August 28, 2025 12:14
MessagePack-CSharp unpacker for Python
def messagepack_csharp_unpack(data: bytes) -> list:
"""
Redistribution Notice:
Properly attribute all entities listed below and request others to follow the same.
Otherwise, DO NOT remove or modify this comment.
Specification (MessagePack for C#):
https://github.com/MessagePack-CSharp/MessagePack-CSharp
Dependencies:
msgpack: https://github.com/msgpack/msgpack-python
lz4: https://github.com/python-lz4/python-lz4
@t-wy
t-wy / fb_post_id_script.js
Created November 28, 2022 12:22
Get Facebook canonical Post ID (share URL) without pfbid parameter
javascript: fbid = /share_fbid":"(\d+)"/g.exec([...document.getElementsByTagName("script")].filter(x => x.innerHTML.includes("share_fbid"))[0].innerHTML)[1]; alert(location.href.split("/").slice(0, -1).join("/") + "/" + fbid);
// can be used in console / bookmark / address bar (remember to add back javascript if the browser strips it automatically)
@t-wy
t-wy / CopyFrametoClipboard.js
Last active July 22, 2022 11:52
HTML Video Element Useful Snippets
javascript: {
let video = document.getElementsByTagName("video")[0];
let canvas = document.createElement("canvas");
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
canvas.getContext("2d").drawImage(video, 0, 0, canvas.width, canvas.height);
canvas.style.position = "fixed";
canvas.style.left = "0";
canvas.style.top = "0";
canvas.style.zIndex = "99999";
@t-wy
t-wy / Paint_turtle.py
Last active July 27, 2024 16:50
A paint application using Python Turtle
import turtle
turtle.tracer(False)
turtle.hideturtle()
"""
Paint Application using Python Turtle
by t-wy
"""
def save():
@Davr1
Davr1 / emojis.json
Last active September 26, 2024 06:21
Guilded emojis
{"NPCs": [{"id": 90000000, "name": "grinning", "category": "NPCs", "order": 1, "src": "https://img.guildedcdn.com/asset/Emojis/grinning.webp", "unicode": "😀", "codepoint": "1f600"}, {"id": 90000004, "name": "smiley", "category": "NPCs", "order": 2, "src": "https://img.guildedcdn.com/asset/Emojis/smiley.webp", "unicode": "😃", "codepoint": "1f603"}, {"id": 90000005, "name": "smile", "category": "NPCs", "order": 3, "src": "https://img.guildedcdn.com/asset/Emojis/smile.webp", "unicode": "😄", "codepoint": "1f604"}, {"id": 90000001, "name": "grin", "category": "NPCs", "order": 4, "src": "https://img.guildedcdn.com/asset/Emojis/grin.webp", "unicode": "😁", "codepoint": "1f601"}, {"id": 90000007, "name": "laughing", "category": "NPCs", "order": 5, "aliases": ["satisfied"], "src": "https://img.guildedcdn.com/asset/Emojis/laughing.webp", "unicode": "😆", "codepoint": "1f606"}, {"id": 90000006, "name": "sweat_smile", "category": "NPCs", "order": 6, "src": "https://img.guildedcdn.com/asset/Emojis/sweat_smile.webp", "unicod
@t-wy
t-wy / _app_store_tiers_readme.md
Last active February 24, 2025 02:48
Get App Store Tiers without using Developer Account

Parts of the functionality may have been broken as App Store allows more flexible pricing options than the original tiers.

@t-wy
t-wy / #kurenaifChallenge Write-up
Last active September 28, 2023 03:13
#kurenaifChallenge Write-up
ツイート Tweet:https://twitter.com/fwarashi/status/1360561289215373314
Github:https://github.com/kurenaif/kurenaif_valentine_problems
ハッシュタグ Hashtag: #kurenaifChallenge (https://twitter.com/search?q=%23kurenaifChallenge)
* GCD (Greatest common divisor・最大公約数) may also be known as HCF, GCF or HCD, GCM
H: highest
F: factor
M: measure
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master