Skip to content

Instantly share code, notes, and snippets.

View ttdoda's full-sized avatar

IWAMOTO Kouichi ttdoda

  • Kanagawa, Japan
View GitHub Profile
@ttdoda
ttdoda / screen-osc10_11.patch
Last active February 5, 2016 18:00 — forked from saitoha/screen-osc11.patch
GNU Screen: Support OSC 10 & 11 sequence (set foreground/background color)
diff -ur ansi.c ansi.c
--- ansi.c 2015-04-08 14:34:29.000000000 +0900
+++ ansi.c 2016-01-19 23:23:20.000000000 +0900
@@ -1554,12 +1554,12 @@
}
#endif
#ifdef RXVT_OSC
- if (typ == 0 || typ == 1 || typ == 2 || typ == 20 || typ == 39 || typ == 49)
+ if (typ == 0 || typ == 1 || typ == 2 || typ == 10 || typ == 11 || typ == 20 || typ == 39 || typ == 49)
{
@ttdoda
ttdoda / xterm-decrqss-decslrm.diff
Created December 3, 2015 05:43
xtermのDECRQSSのバグ修正
--- misc.c.orig 2015-08-19 09:54:21.000000000 +0900
+++ misc.c 2015-12-02 17:41:53.123879000 +0900
@@ -4059,6 +4059,9 @@
screen->lft_marg + 1,
screen->rgt_marg + 1);
}
+ else {
+ okay = False;
+ }
} else if (!strcmp(cp, "m")) { /* SGR */
@ttdoda
ttdoda / paste64.zsh
Last active June 17, 2020 14:03
OSC 52 でのクリップボード書き込み (zsh用関数定義)
#
# paste64 -- OSC 52 (PASTE64) を利用した端末エミュレータ経由でのクリップボード書き込み
#
# 使い方:
# % ls | paste64
# ls の結果をクリップボードに書き込む。
#
# % cat hoge | nkf -s | paste64
# ファイル hoge の内容(日本語を含む)をクリップボードに書き込む。
# 漢字コードの扱いは端末依存。
@ttdoda
ttdoda / gist:fc7fa7ea1b774f6597f8
Created November 24, 2015 13:50
Graf Zeppelin ドロップ確率
% ruby -e '10.step(200,10) do |i| puts "%3d: %f\n"%[i, (1 - (1-0.025) **i) * 100] end'
10: 22.367038
20: 39.731232
30: 53.211570
40: 63.676756
50: 71.801190
60: 78.108428
70: 83.004924
80: 86.806219
90: 89.757277
@ttdoda
ttdoda / pyonpyon.rb
Last active August 4, 2017 18:56
あぁ^~端末がぴょんぴょんするんじゃぁ^~
#!/usr/bin/env ruby
#
# License: CC0
#
gravity = 3
require 'timeout'
include Math
$stdout.sync = 1
@ttdoda
ttdoda / byonbyon.rb
Last active April 26, 2017 01:17
端末のウィンドウが勝手にびよんびよんなってたのしいやつ
#!/usr/bin/env ruby
# License: CC0
include Math
STDOUT.sync = 1
case `env LC_ALL=C stty -a`
when / (\d+) rows; (\d+) columns/
rows = $1.to_i
@ttdoda
ttdoda / moduli-bits.lis
Created August 21, 2015 11:45
OpenSSH portable moduli bits
ver 1024 1536 2048 3072 3192 4096 6144 7680 8192
openssh-2.9.9p1 38 31 36 - 36 14 - - -
openssh-2.9.9p2 38 31 36 - 36 14 - - -
openssh-3.0p1 38 31 36 - 36 14 - - -
openssh-3.0.1p1 38 31 36 - 36 14 - - -
openssh-3.0.2p1 38 31 36 - 36 14 - - -
openssh-3.1p1 38 31 36 - 36 14 - - -
openssh-3.2.2p1 38 31 36 - 36 14 - - -
openssh-3.2.3p1 38 31 36 - 36 14 - - -
openssh-3.3p1 38 31 36 - 36 14 - - -
@ttdoda
ttdoda / w3m-sgr-style-menu.diff
Last active August 29, 2015 14:26
SGR 1006 mouse reporting for w3m's menu
--- menu.c.orig 2011-01-04 18:22:23.000000000 +0900
+++ menu.c 2015-08-05 17:37:19.035511000 +0900
@@ -57,6 +57,7 @@
static int mClose(char c);
static int mSusp(char c);
static int mMouse(char c);
+static int mSgrMouse(char c);
static int mSrchF(char c);
static int mSrchB(char c);
static int mSrchN(char c);
diff --git a/main.c b/main.c
index 9cac333..7c5780c 100644
--- a/main.c
+++ b/main.c
@@ -5561,6 +5561,7 @@ DEFUN(sgrmouse, SGRMOUSE, "SGR 1006 mouse operation")
else
return;
} while (1);
+ if (x>0) x--;
@ttdoda
ttdoda / w3m-sgr-style.diff
Last active August 29, 2015 14:26 — forked from saitoha/w3m-sgr-style.diff
SGR 1006 mouse reporting for w3m
Index: keybind.c
===================================================================
RCS file: /cvsroot/w3m/w3m/keybind.c,v
retrieving revision 1.10
diff -u -r1.10 keybind.c
--- keybind.c 29 May 2006 12:17:25 -0000 1.10
+++ keybind.c 14 Jul 2012 21:20:27 -0000
@@ -91,7 +91,7 @@
/* 0 1 2 3 4 5 6 7 */
nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd,