Skip to content

Instantly share code, notes, and snippets.

View oboenikui's full-sized avatar

Takaki Hoshikawa oboenikui

View GitHub Profile
@oboenikui
oboenikui / dajare.cherri
Last active December 21, 2023 17:52
CherriでSiriショートカットを実装
#define glyph chatbox
#define color yellow
#define inputs text
#define from menubar, sleepmode, sharesheet, watch
#define name ダジャレで返信する
@input0 = "{ShortcutInput}"
@input = input0
@inputLength = countChars(input)
@oboenikui
oboenikui / LoginForm.kt
Created June 27, 2023 17:42
Jetpack Composeの自動入力サンプル
@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
@Composable
fun LoginForm() {
var loginId by remember { mutableStateOf("") }
var password by remember { mutableStateOf("") }
val loginIdAutofillNode = AutofillNode(
autofillTypes = listOf(AutofillType.Username, AutofillType.EmailAddress),
onFill = { loginId = it }
)
val passwordAutofillNode = AutofillNode(
@oboenikui
oboenikui / tweetdeck.md
Last active February 7, 2023 07:40
TweetDeckのバージョン切り替えブックマークレット

TweetDeckのバージョン切り替えブックマークレット

TweetDeckのページを開いてる状態で実行してください。

旧版にする

javascript:document.cookie='tweetdeck_version=legacy;%20domain=.twitter.com';0
@oboenikui
oboenikui / AndroidGradleConfig.md
Created July 20, 2019 10:37
Change gradle config of mvnrepository.com for Android

JavaScript code

document.getElementById("gradle-a").value = document.getElementById("gradle-a").value
    .replace(/group: '(.*)', name: '(.*)', version: '(.*)'/, "'$1:$2:$3'")
    .replace(/Compile/, 'Implementation')
    .replace(/^compile/, 'implementation');

Bookmarklet

@oboenikui
oboenikui / gen-kotlin-jackson.js
Last active November 29, 2017 15:41
JSONからJackson用Kotlin data class生成
function generate(obj, className, current) {
if(!current) current = ""
var keys = Object.keys(obj)
var props = keys.map(key=>[toKotlinType(obj[key], key), key])
.map(([className, variableName]) => {
if (typeof obj[variableName] == "object" && !(obj[variableName] instanceof Array))
current = travel(obj[variableName], className, current);
else if(obj[variableName] instanceof Array)
current = travel(obj[variableName][0], toUCC(variableName), current);
(()=>{
let responseImage = new Image();
responseImage.style.maxWidth = "100%";
responseImage.style.display = "block";
let canvas = document.createElement("canvas");
document.querySelector('body > form > input[type="submit"]').style.display = "none";
document.getElementById("id_image").addEventListener("change", ev=>{
let files = ev.target.files;
if (!files.length || !files[0].type.match(/^image\/(png|gif|jpeg)$/))
return;
@oboenikui
oboenikui / UnivFeliCa.md
Last active June 12, 2024 00:34
大学生協FeliCaの仕様

WHAT IS THIS

大学生協のFeliCa,及び諸大学の学生証一体型FeliCaの仕様
レスポンスについては,特に表記のない限り東北大学のもの (学生証一体型ではない)
断りのない限りコードはビッグエンディアンで通信する (下記のドキュメントに合わせた)
記号と区別するため,アルファベットの大文字表記は記号,小文字表記は16進表記とする

FeliCa自体の仕様については,Sony公式のドキュメントを参考に

System Code

@oboenikui
oboenikui / normalize_onair_date.txt
Last active July 5, 2016 16:30
放送時間表記の正規化のイメージ
if 放送日時.時 < 4:
放送日時.日 += 1
else if 放送日時.時 >= 24:
放送日時.日 += 1
放送日時.時 -= 24
end if
// Type definitions for nodejs-websocket
// Project: https://github.com/sitegui/nodejs-websocket
// Definitions by: oboenikui <https://github.com/oboenikui>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module "nodejs-websocket" {
import tls = require('tls');
import net = require('net');
@oboenikui
oboenikui / Recovery.java
Created April 13, 2016 03:26
GitBucketのデータベースを修復するやつ
import java.io.*;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Recovery {
public static void main(String[] args) throws IOException {
BufferedReader reader1 = new BufferedReader(new InputStreamReader(new FileInputStream(new File("to.txt"))));
BufferedReader reader2 = new BufferedReader(new InputStreamReader(new FileInputStream(new File("from.txt"))));
String line = "", line1 = reader1.readLine(), line2 = reader2.readLine();