Skip to content

Instantly share code, notes, and snippets.

View uwabami's full-sized avatar

Youhei SASAKI uwabami

View GitHub Profile
Verifying that I control the following Nostr public key: npub1x7ckqyp8nvr8ufullf72t79l6fmz6a7ulkfq76c46rgfxrjce9fqy4fkgn
@uwabami
uwabami / amp_img_filter.rb
Created February 1, 2020 01:18
jekyll で <img> を <amp-img> に変換する liquid filter. {{ content | amp_images }} とでもすると良い.
#
#= Jekyll Plugin: replace '<img>' to '<amp-img>' with fallback, noscript
#
# Original: https://github.com/juusaw/amp-jekyll/lib/jekyll/amp_filter.rb
# License: MIT/X11
# Note:
# - You have to set <img> with width and height
# - You have to add .png and .webp
require 'nokogiri'
@uwabami
uwabami / zotero-standalone-posthook.sh
Created May 26, 2017 08:10
Debian で zotero 用に pdftotext と pdfinfo を使う準備をするスクリプト
#!/bin/bash
echo "### Setup pdfinfo and pdftext for Debian ###"
echo "- see https://bugs.debian.org/cgi-bin/bugreport.cgi?att=2;bug=781009"
echo -n "poppler-utils version: "
version=$(dpkg-query -W -f='${Version}' poppler-utils || echo "please_install_poppler-utils")
echo "${version}"
ARCH=`dpkg-architecture -qDEB_HOST_GNU_CPU`
binary_suffix="Linux-${ARCH}"
@uwabami
uwabami / xbacklight
Created May 22, 2017 04:11
xbacklight っぽく gsd-backlight-helper を呼び出すシェルスクリプト
#!/bin/sh
PKEXEC=/usr/bin/pkexec
GSD=/usr/lib/gnome-settings-daemon/gsd-backlight-helper
GETOPT=/usr/bin/getopt
OPT=`getopt -a -o sg --long set, --long get -- "$@"`
show_usage(){
echo "Usage $0 [--get] [--set number]" 1>&2
}
if [ $? != 0 ]; then
show_usage
@uwabami
uwabami / 0003-Unforce-locale-en_US.UTF-8.patch
Last active January 9, 2018 04:05
tmux v2.6 で en_US.UTF-8 決め打ちを止める.ロケールの修正か wcwidth-cjk を使うことを前提とする
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Tue, 9 Jan 2018 13:03:58 +0900
Subject: Unset locale forcing
Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
tmux.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/tmux.c b/tmux.c
@uwabami
uwabami / 0001-Use-ASCII-char-for-box-drawning-with-option-pane-bor.patch
Last active December 4, 2019 04:37
tmux v2.6 で 罫線描画を全て ASCII とする patch. 代替文字として良いのがあったら教えて下さい
From: Youhei SASAKI <uwabami@gfd-dennou.org>
Date: Fri, 27 Oct 2017 12:32:42 +0900
Subject: Use ASCII char for box drawning with option pane-border-ascii
Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
---
options-table.c | 6 ++++++
tty-acs.c | 67 +++++++++++++++++++++++++++++----------------------------
2 files changed, 40 insertions(+), 33 deletions(-)
@uwabami
uwabami / bluefeather.rb.patch
Created May 15, 2017 08:19
Redmine Markdown Extra Formatter で `[[マルチバイト]]` を扱うための bluefeather の dirty hack
--- bluefeather.rb.orig 2017-05-15 16:20:07.025427957 +0900
+++ bluefeather.rb 2017-05-15 16:20:41.598133562 +0900
@@ -1807,7 +1807,7 @@
@log.debug "%p" % @scanner.string[ startpos-1 .. @scanner.pos-1 ]
rs.warnings << "link-id not found - #{linkid}"
- text += @scanner.string[ startpos-1 .. @scanner.pos-1 ]
+ text += '[' + link + ']' + @scanner[0]
end
diff --git a/src/rxvtfont.C b/src/rxvtfont.C
index 1914539..4c0189e 100644
--- a/src/rxvtfont.C
+++ b/src/rxvtfont.C
@@ -1223,92 +1223,63 @@ rxvt_font_xft::load (const rxvt_fontprop &prop, bool force_prop)
return false;
int ftheight = 0;
- bool success = true;
-
@uwabami
uwabami / uim-off.c
Created February 11, 2017 07:36
commandline から uim を問答無用で off にする
#include <stdio.h>
#include <uim/uim.h>
#include <uim/uim-helper.h>
int main(void)
{
int fd;
// initalize
fd = uim_helper_init_client_fd(NULL);
if (fd < 0) {
fprintf(stderr, "error: uim_helper_init_client_fd()\n");