Skip to content

Instantly share code, notes, and snippets.

View kobachi's full-sized avatar

kobachi kobachi

View GitHub Profile
@kobachi
kobachi / highlight.js
Last active May 1, 2024 01:25
Text Highlighting
/**
1. Find TextNode contains specified text using XPath
2. Collect TextNode from XPath snapshot result into array
3. Edit TextNode with 3 steps below, eg. ```<p>ABCあいうXYZ</p>``` (highlight: ```あいう```)
1. Split prefix from ```ABCあいうXYZ```[1], and replace [1] to prefix ```ABC```[2]. (Temporally result: ```<p>ABC</p>```)
2. Append suffix ```XYZ```[3] after [2]. (Temporally result: ```<p>ABC``` ```XYZ</p>```)
3. Insert highlight node ```<span class="highlight">あいう</span>``` before suffix [3].
4. Final result: ```<p>ABC<span class="highlight">あいう</span>XYZ</p>```
*/
const highlight = (text) => {
; Microsoft Designer Compact Keyboardの[A][あ]を[無変換][変換]にする
vk16::sc079
vk1a::sc07b
; Ctrl+WをCtrl+F4、Ctrl+QをAlt+F4にする
^w::^F4
^q::!F4
; Win+Cで現在のウィンドウをキャプチャしてデスクトップにPNGファイルとして保存 (IfranView使用)
#c::Run("C:\Program Files\IrfanView\i_view64.exe" " /capture=2 /convert=" A_Desktop "\capture_$U(%Y%m%d%H%M%S).png")
@kobachi
kobachi / custom-font-remover.user.js
Last active March 19, 2022 10:49
Custom Font Remover
// ==UserScript==
// @name Custom Font Remover
// @version 2.1
// @include http://*
// @include https://*
// @grant none
// ==/UserScript==
const GM_log = () => {};//unsafeWindow.console.log;
const BLACK_LIST = [
@kobachi
kobachi / selection-disabler-canceller.user.js
Last active March 19, 2022 10:50
Selection Disabler Canceller
// ==UserScript==
// @name Selection Disabler Canceller
// @version 1.1
// @include http://*
// @include https://*
// @grant none
// ==/UserScript==
(() => {
@kobachi
kobachi / open-folder-with-vscode-install.ja.reg
Created July 26, 2021 02:26
「Visual Studio Codeで開く」をフォルダのコンテキストメニューに追加(Program Filesにインストールされている場合)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@="Visual Studio Codeで開く(&V)"
"Icon"=hex(2):22,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,\
00,6c,00,65,00,73,00,25,00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,\
66,00,74,00,20,00,56,00,53,00,20,00,43,00,6f,00,64,00,65,00,5c,00,43,00,6f,\
00,64,00,65,00,2e,00,65,00,78,00,65,00,22,00,2c,00,30,00,00,00
[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@kobachi
kobachi / pocket_direct_linkify.user.js
Last active July 9, 2021 06:01
Pocket Direct Linkify
// ==UserScript==
// @name Pocket Direct Linkify
// @description Rewrite Pocket item link to directly opens original website
// @namespace kobachi.dev
// @version 2.2
// @include https://getpocket.com/my-list
// ==/UserScript==
(function() {
function simplify(articles) {
@kobachi
kobachi / android_gradle_dependency_formatter.user.js
Last active July 2, 2021 00:52
Android Gradle Dependency Formatter
// ==UserScript==
// @name Android Gradle Dependency Formatter
// @description Re-format mvnrepository.com's Gradle dependency for Android Gradle
// @namespace kobachi.dev
// @version 1.0
// @include https://mvnrepository.com/artifact/*
// ==/UserScript==
(function () {
var textarea = document.querySelector("#gradle-div > textarea");
@kobachi
kobachi / google_search_tracking_remover.user.js
Last active July 6, 2021 02:04
Google Search Tracking Remover
// ==UserScript==
// @name Google Search Tracking Remover
// @description Remove click tracking from Google search result
// @namespace kobachi.dev
// @version 1.2
// @include https://www.google.co*/search*
// @include http://www.google.co*/search*
// ==/UserScript==
(function(){
@kobachi
kobachi / debian_install-amazon-corretto.sh
Last active June 29, 2021 12:02
Install Amazon Corretto to Debian. Step by step.
# Install pre-requirements
sudo apt install gnupg software-properties-common
# Add GPG key
curl https://apt.corretto.aws/corretto.key | sudo apt-key add -
# Add Amazon Corretto repository
sudo add-apt-repository 'deb https://apt.corretto.aws stable main'
# Update and Check
function urlencode {
t=$(echo "$1" | nkf -WwMQ | sed 's/=$//g' | tr = % | tr -d '\n')
echo ${t//\%2F/\/}
}