Skip to content

Instantly share code, notes, and snippets.

View lo48576's full-sized avatar
✔️
activated

YOSHIOKA Takuma lo48576

✔️
activated
View GitHub Profile
@lo48576
lo48576 / README.md
Last active February 28, 2020 08:17
XSL filter for my blog (at 2018-12-13), with XSL dependency tracking

Customized XSL filter for nanoc

Features

  • Track dependency files for each layout XSL files.
  • Use correct base path for imports / includes
    • Current nanoc (4.11) uses the current directory (project root) for base path of XSLT includes / imports. href.content = (xsl_dir + href).relative_path_from(current_dir).to_s fixes this.

Known problems

No cache for dependencies

@lo48576
lo48576 / Dockerfile.sample
Last active December 15, 2018 10:51
A patch to use ConoHa object storage from Nextcloud 14.0.0
FROM nextcloud:14.0.0-apache
COPY support-conoha-object-storage.patch /support-conoha-object-storage.patch
RUN cd /usr/src/nextcloud && patch -p1 --force </support-conoha-object-storage.patch
@lo48576
lo48576 / fonts.conf
Created August 21, 2018 05:18
fonts.conf at 2018-08-21
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>VLPGothic</string>
@lo48576
lo48576 / git-repo-xkeyboard-config-2.31-add-lo48576-opts.patch
Last active October 26, 2020 12:10
xkeyboard-config-2.31 の git リポジトリや tar 展開後ファイル群に当てるパッチ。「変換」キーを Super として使う設定と「カタカナひらがなローマ字」を Ctrl として使う設定。
commit e9547b95589eaf45068076a5a05be8a25b8e9df2
Author: YOSHIOKA Takuma <lo48576@hard-wi.red>
Date: 2018-04-02 14:25:11 +0900
Add custom settings for @lo48576
diff --git a/rules/0042-o_s.part b/rules/0042-o_s.part
index 0b03935b7e75..fe5ad64b398f 100644
--- a/rules/0042-o_s.part
+++ b/rules/0042-o_s.part
@lo48576
lo48576 / README.md
Last active April 25, 2020 19:17
ambiwidth patches

Ambiwidth 環境整備用情報

charmap

glibc 標準の /usr/share/i18n/charmaps/UTF-8 は、 ambiwidth characters が1文字幅になっている。 https://github.com/eagletmt/misc/blob/master/ruby/ambiwidth.rb を使うと、これらを2文字幅にした UTF-8-CJK ファイルを作成できる。

zsh

zsh は、一部の結合文字などに対する wcwidth 等の誤った文字幅判定を防ぐため、 configure 時にテストを行い、理想的な wcwidth 実装でなかった場合に内部的な実装 (wcwidth9) に切り替える。

@lo48576
lo48576 / README.md
Created January 25, 2018 07:22
2018-01-25: UTF-8 locale for CJK, and a patch to force zsh to use system `wcwidth()`.

2018-01-25

UTF-8-CJK

A charmap with ambiwidth and private characters set full-width.

Usage:

  • Gzip it and copy to /usr/share/i18n/charmaps/UTF-8-CJK.gz.
  • Edit /etc/locale.gen and use UTF-8-CJK for a locale you use.   For me, ja_JP.UTF-8 UTF-8-CJK and en_US.UTF-8 UTF-8-CJK.
@lo48576
lo48576 / lazy_file.rs
Last active December 30, 2017 12:23
ファイル遅延ロード(ちょっと設計が微妙なので採用見送り、これは供養兼バックアップ)
//! Lazily loadable file type and related stuff.
// This code is dual licensed under MIT/Apache-2.
// lazy-init = "^0.2"
extern crate lazy_init;
use std::borrow::Borrow;
use std::cmp;
use std::fmt;
@lo48576
lo48576 / log.txt
Created December 20, 2017 10:13
2017-12-20-rustup-nightly-rustfmt
$ rustc +nightly --version
rustc 1.24.0-nightly (edbd7d232 2017-12-20)
$ diff ~/.cargo/bin/{rustfmt,rustdoc}
$ rustup run nightly rust-gdb rustfmt
GNU gdb (Gentoo 8.0.1 vanilla) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
@lo48576
lo48576 / never-type-coercion.md
Last active December 7, 2017 13:54
Rust での発散と型推論とセミコロンあたりの挙動について、疑問と答えと経緯の調査。そのうちブログにまとめる予定の話のメモ。

発散と 型推論と セミコロン Rustにおける 疑問と答え #57577

雑なメモ。 そのうちフォーマットしてブログにまとめる予定。

内容は 2017-10-14 およびそれ以前の情報に基く。

更新

過去のこのファイルの内容にはいくらかのミスや古くなった内容などがあるため、内容を更新しつつブログに書き直した。 Rust での never type とセミコロン、型推論のルール変遷 - 何とは言わない天然水飲みたさ を参照されたい。

@lo48576
lo48576 / docker-compose.yaml
Created September 25, 2017 08:05
GNU Social setup sample for gnusocial.cardina1.red
version: "2.1"
services:
nginx-proxy:
restart: always
# nginx:latest uses debian.
#image: nginx:latest
# alpine version uses newer openssl and supports ALPN (i.e. it supports http/2 better) (2017-01-19).
image: nginx:alpine
ports: