Skip to content

Instantly share code, notes, and snippets.

View rinsuki's full-sized avatar

rinsuki rinsuki

View GitHub Profile
import glob
import plistlib
FAKE_VERSION = b"22G74"
for file in glob.iglob("**/Info.plist", recursive=True):
if ".storyboardc/" in file:
continue
print(file)
with open(file, "rb") as fp:
const BLOCK_SIZE: usize = 4 * 1024 * 1024;
/// Implementation of Dropbox's Content Hash.
/// See https://www.dropbox.com/developers/reference/content-hash
pub struct ContentHash {
entire_hasher: ring::digest::Context,
block_hasher: ring::digest::Context,
block_position: usize,
}
objc[4253]: Class _TtC4GRDB8Database is implemented in both /System/Library/PrivateFrameworks/GRDB.framework/GRDB (0x1df0ed2c0) and /private/var/containers/Bundle/Application/<UUID>/iMast.app/Frameworks/GRDB.framework/GRDB (0x104b3f8c0). One of the two will be used. Which one is undefined.
objc[4253]: Class _TtC4GRDB17DatabaseCollation is implemented in both /System/Library/PrivateFrameworks/GRDB.framework/GRDB (0x1df0ec5a0) and /private/var/containers/Bundle/Application/<UUID>/iMast.app/Frameworks/GRDB.framework/GRDB (0x104b3fbf0). One of the two will be used. Which one is undefined.
objc[4253]: Class _TtC4GRDB16DatabaseFunction is implemented in both /System/Library/PrivateFrameworks/GRDB.framework/GRDB (0x1df0ec510) and /private/var/containers/Bundle/Application/<UUID>/iMast.app/Frameworks/GRDB.framework/GRDB (0x104b3fd88). One of the two will be used. Which one is undefined.
objc[4253]: Class _TtCC4GRDB16DatabaseFunctionP33_1F1016B0E130FBD1433DD56AD149CDA818FunctionDefinition is implemented in both /Syste
import json
import sys
with open(sys.argv[1], "r") as f:
data = json.load(f)
out = []
for checkin in data:
if checkin.get("private", False):
continue
should_skip = False
@rinsuki
rinsuki / typeorm-npm-0.3.6-8a40e705ca.patch
Last active June 26, 2022 17:00
yarn patch for typeorm@0.3.6 with TS 4.7
diff --git a/package.json b/package.json
index 36b0d579bce1cea8f9bbe373a92f28eb275d72a5..ccfe1dd9cac7d6792f1dfe4cba845748f3c2fbdb 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,7 @@
},
"exports": {
".": {
+ "types": "./index.d.ts",
"node": {
@rinsuki
rinsuki / extract-niconico-mylist-from-twitter-data.py
Created February 22, 2022 05:36
Twitterデータ(DLできるやつ)からニコニコのマイリストしたログを抽出
import json
import datetime
import sys
dir = sys.argv[1]
def jsloader(o):
with open(dir + "/" + o["fileName"], "r") as f:
r = f.read()
prefix = "window." + o["globalName"] + " = "
if not r.startswith(prefix):
raise Exception("???")
@rinsuki
rinsuki / PokemonDP_How_to_Use_Azure_Flute.md
Last active April 28, 2022 15:20
ポケモンDPのASEで「てんかいのふえ」イベントを見る

ポケモンDPのASEを利用して「てんかいのふえ」イベントを見る

ポケモンDPで昨年12月から話題となっている Arbitrary Script Execution (ASE) を利用した「てんかいのふえ」イベントを見る方法を発見したので紹介します。

質問等があればこのgistにコメントするか このツイート にリプライを送ってください。

(ブロックされてたら…ごめんなさい。結構雑にブロックしてるのでひょっとするとあなたのことをブロックしているかもしれません。どうしても聞きたい場合は https://rinsuki.net/ にメールアドレスが書いてあるのでこちらに送ってください)

CREATE OR REPLACE FUNCTION check_header_array(arr text[]) RETURNS BOOLEAN LANGUAGE plpgsql AS $$
DECLARE
h text[];
i text;
BEGIN
FOREACH h SLICE 1 IN ARRAY arr
LOOP
IF array_ndims(h) != 1 THEN RETURN false; END IF;
IF array_length(h, 1) != 2 THEN RETURN false; END IF;
FOREACH i IN ARRAY arr
@rinsuki
rinsuki / Disable Apple Music.mobileconfig
Created October 19, 2021 00:02
Disable Apple Music in macOS 12 Monterey Music.app
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDescription</key>
<string>Disable Apple Music in Music.app</string>
<key>PayloadDisplayName</key>
@rinsuki
rinsuki / twitter_api_ratelimits.json
Last active November 18, 2021 06:43
Twitter API Rate Limits
{
"profile_spotlight": {
"/profile_spotlight/show": {
"limit": 180,
"remaining": 180,
"reset": 1627498153
}
},
"explore": {
"/explore/tiles": {