This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
def float_to_hex(f): | |
"""Convert a float to hex representation in little endian format.""" | |
return struct.pack('<d', f).hex() | |
def convert_to_hex(meters): | |
"""Convert meter value to IEEE 754 hex representation.""" | |
float_hex = float_to_hex(meters) | |
# Extract the last 8 bytes (16 hex characters) and format the hex string to match the given output format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[string]$Year, # yyyy部分を引数として指定 | |
[int]$MaxParallel = 10 # 並列実行の最大数を指定(デフォルト10) | |
) | |
$sourceFolder = "N:\Users\tomachi\Pictures\VRChat" | |
$destinationFolder = "N:\Users\tomachi\Pictures\VRChat\webp" | |
$ffmpegPath = "ffmpeg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import json | |
import os | |
import zipfile | |
from tqdm import tqdm | |
class FileSystemTree: | |
def __init__(self, relative_path, absolute_path, children=None, timestamp=None): | |
self.relative_path = relative_path | |
self.absolute_path = absolute_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get all bonus data from the page | |
* | |
* @returns {Array} - Array of all bonus data | |
*/ | |
function get_all_bonus() { | |
const all_bonus = JSON.parse(document.querySelector('div[data-react-class="App"]').getAttribute("data-react-props")).values.all_bonus | |
const results = [] | |
for (const bonus of all_bonus) { | |
const pay_on = bonus.pay_on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
# jq がインストールされていない場合はインストールする | |
if ! type jq > /dev/null 2>&1; then | |
sudo apt-get install -y jq | |
fi | |
# frp の最新バージョンを取得する | |
latest_tag=$(curl -s https://api.github.com/repos/fatedier/frp/releases/latest | jq -r '.tag_name') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
gl.rowid AS join_id, | |
gl.created_at AS world_created_at, | |
gl.location AS instance_id, | |
gl.world_id AS world_id, | |
gl.world_name AS world_name, | |
gl.time AS instance_elapsed_time, | |
gl.group_name AS instance_group_name, | |
gvp.created_at AS video_created_at, | |
gvp.video_url AS video_url, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sqlite3 | |
import pandas as pd | |
import os | |
appdata_path = os.getenv('APPDATA') | |
dbpath = os.path.join(appdata_path, 'VRCX', 'VRCX.sqlite3') | |
print("DB Path: " + dbpath) | |
conn = sqlite3.connect(dbpath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub ListSheetNames() | |
Dim ws As Worksheet | |
Dim sheetNames() As String | |
Dim i As Integer | |
Dim listSheet As Worksheet | |
' 画面更新と自動計算を一時停止 | |
Application.ScreenUpdating = False | |
Application.Calculation = xlCalculationManual | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd "$(dirname "$0")" || exit 1 | |
# ロックファイルのパス | |
LOCKFILE="$(realpath "$0").lock" | |
# ファイルディスクリプタ9でロックを取得 (エラーメッセージを無視) | |
exec 9>"$LOCKFILE" 2>/dev/null | |
if [ $? -ne 0 ]; then | |
echo "Failed to open lockfile $LOCKFILE. It seems to be already running." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This script is for toggling all bookmarks on pixiv to public or private. | |
Open your own pixiv user page, switch to the bookmarks tab, and then run this script in the browser console. | |
(e.g., https://www.pixiv.net/users/{userId}/bookmarks/artworks) | |
*/ | |
/** | |
* Wait for an element to appear in the DOM and resolve with it. | |
* |
NewerOlder