Skip to content

Instantly share code, notes, and snippets.

@takana-v
takana-v / getblocktemplate.json
Created April 11, 2021 12:40
getblocktemplate "{\"rules\": [\"segwit\"]}"
{
"capabilities": [
"proposal"
],
"version": 536870912,
"rules": [
"csv",
"!segwit",
"taproot"
],
pragma solidity 0.5.4;
contract helloWorld {
string data;
function pureHelloWorld() public pure returns(string memory) {
return "hello world";
}
function readStrData() external view returns(string memory) {
return data;
}
function sendStrData(string memory sendData) public {
[
{
"constant": true,
"inputs": [
{
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
[
{
"constant": true,
"inputs": [
{
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
import unicodedata
hankaku_alphabet = "".join(chr(0x21 + i) for i in range(94))
zenkaku_alphabet = "".join(chr(0xff01 + i) for i in range(94))
translate_table = str.maketrans(hankaku_alphabet, zenkaku_alphabet)
original_dict = "/path/to/naist-jdic.csv"
normalized_dict = "/path/to/normalized.csv"
def text_normalize(text: str):
@takana-v
takana-v / quest_fbt.py
Last active November 24, 2022 11:45
VRChatでQuest単体でフルトラするやつ
# quest_fbt.py
# Copyright (c) 2022 takana-v
#
# This software is released under the MIT License.
# http://opensource.org/licenses/mit-license.php
import math
from pythonosc import udp_client
import openvr
# vv_core_wrapper.py
# Copyright (c) 2022 takana-v
#
# This software is released under the MIT License.
# http://opensource.org/licenses/mit-license.php
import faulthandler
import json
from ctypes import *
@takana-v
takana-v / maskmap2builtinshadermaps.py
Last active February 19, 2023 10:13
UnityのMaskmapをMetallic/Occlusion/Detail Mapに変換するスクリプト
from pathlib import Path
import numpy as np
from PIL import Image
def open_maskmap(path: Path) -> np.ndarray:
img = Image.open(path)
return np.asarray(img)