Skip to content

Instantly share code, notes, and snippets.

View kyohsuke's full-sized avatar
🇯🇵

KAWAHARA Keisuke kyohsuke

🇯🇵
View GitHub Profile
package main
import (
"cmp"
"fmt"
)
type CommResult[T cmp.Ordered] struct {
OnlyA []T // column 1
OnlyB []T // column 2
@kyohsuke
kyohsuke / reply_filter.user.js
Last active July 5, 2026 06:42
X Reply Filter
// ==UserScript==
// @name X Reply Filter
// @version 1.1.0
// @description Filter replies on X
// @match https://x.com/*
// @match https://twitter.com/*
// @homepageURL https://gist.github.com/kyohsuke/5a1915b10c2ccd12b781a85b4a2f0f0a
// @updateURL https://raw.github.com/gist/kyohsuke/5a1915b10c2ccd12b781a85b4a2f0f0a/raw/twrefresh.user.js
// @downloadURL https://raw.github.com/gist/kyohsuke/5a1915b10c2ccd12b781a85b4a2f0f0a/raw/twrefresh.user.js
// @icon https://help.twitter.com/content/dam/help-twitter/brand/logo.png
// ==UserScript==
// @name YouTube Shorts to Normal watch
// @version 1.0.0
// @description Automatically move shorts to watch URL
// @author kyohsuke
// @match https://www.youtube.com/shorts/*
// @homepageURL https://gist.github.com/kyohsuke/7ff0d2347d3704a2a7472d205b80c7ec
// @updateURL https://gist.githubusercontent.com/kyohsuke/7ff0d2347d3704a2a7472d205b80c7ec/raw/youtubeShortsReplacer.user.js
// @downloadURL https://gist.githubusercontent.com/kyohsuke/7ff0d2347d3704a2a7472d205b80c7ec/raw/youtubeShortsReplacer.user.js
// @icon https://cdn3.iconfinder.com/data/icons/social-network-30/512/social-06-1024.png
// ==UserScript==
// @name Auto Refresh YouTube Live
// @description Automatically tracks live head for YouTube Live
// @match https://www.youtube.com/*
// @version 1.0.7
// @homepageURL https://gist.github.com/kyohsuke/eac69ddef61d4cd8d165c8b2e59ff0ef
// @updateURL https://gist.githubusercontent.com/kyohsuke/eac69ddef61d4cd8d165c8b2e59ff0ef/raw/youtubeLiveObserver.user.js
// @downloadURL https://gist.githubusercontent.com/kyohsuke/eac69ddef61d4cd8d165c8b2e59ff0ef/raw/youtubeLiveObserver.user.js
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==UserScript==
// @name Auto Refresh Twitter Timeline
// @description Automatically refreshes follow timeline on Twitter.
// @match https://twitter.com/*
// @match https://x.com/*
// @version 1.9.8
// @homepageURL https://gist.github.com/kyohsuke/21c3b0ca532a87a1b3f357dfc94d3f24
// @updateURL https://raw.github.com/gist/kyohsuke/21c3b0ca532a87a1b3f357dfc94d3f24/raw/twrefresh.user.js
// @downloadURL https://raw.github.com/gist/kyohsuke/21c3b0ca532a87a1b3f357dfc94d3f24/raw/twrefresh.user.js
// @icon https://help.twitter.com/content/dam/help-twitter/brand/logo.png
// https://twitter.com/search?q=lang%3Aja%20filter%3Areplies%20(card_domain%3Abnc.lt%EF%BD%9Ccard_domain%3Afanlink.to%20%EF%BD%9Ccard_domain%3An9oi1.app.link)&src=typed_query&f=live
// ↑ にアクセスして ↓ をコンソールにこぴぺ
const interval = 3000;
function delBnc() {
let tweets = document.evaluate('//article[@data-testid="tweet"]//div[@aria-label="もっと見る"]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
let elem = tweets.snapshotItem(0);
if(elem != null) {
let targetDOMRect = elem.getBoundingClientRect();
// ==UserScript==
// @name Remove Twitch Front Page Recommended
// @namespace http://tampermonkey.net/
// @version 1.0.2
// @description twitch.tv のトップページにあるレコメンドを停止して削除するヤツ
// @author kyohsuke (based on dani12817's userscript)
// @downloadURL https://gist.github.com/kyohsuke/36737998a25e2ee5583ea4758c708ea7/raw/twitchRemoveFrontReco.user.js
// @updateURL https://gist.github.com/kyohsuke/36737998a25e2ee5583ea4758c708ea7/raw/twitchRemoveFrontReco.user.js
// @match https://www.twitch.tv/*
// @icon https://static.twitchcdn.net/assets/favicon-32-e29e246c157142c94346.png
diff --git a/doc/tags-ja b/doc/tags-ja
index 599c145..cd03870 100644
--- a/doc/tags-ja
+++ b/doc/tags-ja
@@ -2089,7 +2089,6 @@ $quote eval.jax /*$quote*
:XMLent insert.jax /*:XMLent*
:XMLns insert.jax /*:XMLns*
:[range] motion.jax /*:[range]*
-:[vV\x16] autocmd.jax /*:[vV\\x16]*
:\bar cmdline.jax /*:\\bar*
@kyohsuke
kyohsuke / streem.rb
Last active October 13, 2015 02:49
matz/streem for Homebrew
require 'formula'
class Streem < Formula
homepage 'https://github.com/matz/streem'
head 'https://github.com/matz/streem.git'
def install
ENV.j1
system "make && make test"
bin.install "bin/streem"
@kyohsuke
kyohsuke / mruby.rb
Created May 16, 2012 08:41
mruby install formula with Homebrew
require 'formula'
class Mruby < Formula
homepage 'http://www.mruby.org/'
head 'https://github.com/mruby/mruby.git'
def install
ENV.j1
system "make"
system "make test"