Skip to content

Instantly share code, notes, and snippets.

View k16shikano's full-sized avatar
💭
I may be slow to respond.

keiichiro shikano k16shikano

💭
I may be slow to respond.
View GitHub Profile
@k16shikano
k16shikano / luline.tex
Created October 2, 2023 03:37
LuaTeXで行分割可能な下線を引く
\documentclass[a4paper,11pt,twocolumn]{ltjsarticle}
\usepackage{luacode,luatexbase}
\usepackage[no-math,deluxe,expert,haranoaji]{luatexja-preset}
\usepackage{nodetree}
\NodetreeRegisterCallback{:post_linebreak_filter:}
\newcommand{\luline}[1]{\bgroup\attribute100=100 #1\egroup}

Keybase proof

I hereby claim:

  • I am k16shikano on github.
  • I am golden_lucky (https://keybase.io/golden_lucky) on keybase.
  • I have a public key whose fingerprint is 0B62 758B 42D9 9036 1D2A F704 6886 CAB0 1633 950A

To claim this, I am signing this object:

@k16shikano
k16shikano / writing.md
Created February 22, 2022 05:49 — forked from LambdaNote/writing.md
記事の書き方

記事の書き方

記事の執筆には、Markdown形式を利用してください。 Markdownにはさまざまな流派がありますが、GitHub Flavored Markdown(https://github.github.com/gfm/ )をベースとした書式を採用します。

書籍を執筆するための形式として考えると、Markdownには不足している機能が多々あります。 しかし、次のような利点があるので、Markdownを採用することにします。

  • 最低限の構造しかないので、見た目でごまかせる余地が少ない
  • 原稿を著者自身が再利用してもらいやすくしたい
@k16shikano
k16shikano / debian-install.md
Last active February 26, 2023 10:02
Debian作業用サーバをインストールするときのまとめ 2022.1(bullseye)

OSインストールとか

mini.isoをUSBメモリに入れて、USBブートする。 amd64向けのISOイメージは、USBメモリに直接cpするだけでブート可能なものができる。

$ curl http://ftp.jp.debian.org/dists/stable/main/installer-arch/current/images/netboot/mini.iso > mini.iso
$ cp mini.iso /dev/sda
$ sync
@k16shikano
k16shikano / ripple.tex
Created February 4, 2021 09:34
扇形に文字を配置するやつ
\documentclass[uplatex,dvipdfmx]{jlreq}
\usepackage{tikz}
\usetikzlibrary {decorations.text}
\def\mycommand#1{\rotatebox{-90}{#1}\relax}
\newlength{\ripplelength}
\newlength{\ripplewidth}
\newcommand{\ripple}[2]{
\settowidth{\ripplelength}{#1}
\setlength\ripplewidth{\dimexpr\ripplelength/3}
\begin{tikzpicture}[remember picture, overlay]
@k16shikano
k16shikano / intersection.scm
Created January 23, 2021 08:58
昇順の整数のリストが複数あったとき、それらの共通部分を抜き出すやつ
; https://twitter.com/golden_lucky/status/1352094822148915201
(use srfi-1)
(define (intersection lss)
(let R ((as (car lss))
(bss (drop-less-all (caar lss) (cdr lss)))
(result '()))
(if (or (null? bss) (null? as))
(reverse result)
@k16shikano
k16shikano / 9q.scm
Last active January 10, 2021 00:38
「九個の?」パズルを解く
; solver for the "9 questions" quize
; http://flash10000.com/archives/823413.html
; https://note.golden-lucky.net/2006/05/1998java-httpwww.html
(use srfi-1)
(define row 9)
(define line 8)
(define q-num 9)
@k16shikano
k16shikano / acronym.bst
Last active January 1, 2021 01:17
スペース区切りかもしれない文字列のアクロニムを3文字ぶん切り出す(u)pbibtex関数(ただし漢字を含む文字列の場合は先頭の2文字を切り出す)
STRINGS { s t str org car result }
INTEGERS { len }
FUNCTION {chop.word}
{ 's :=
'len :=
s #1 len substring$ =
{ s len #1 + global.max$ substring$ }
{ s }
if$
@k16shikano
k16shikano / wakati-test.tex
Created December 7, 2020 09:23
Mecabを使って改行位置をいい感じに調整する(LuaTeX)
% inspired by https://tech.aptpod.co.jp/entry/2020/11/20/160000
% with http://taku910.github.io/mecab/
% ref. https://tex.stackexchange.com/questions/500372/conditional-string-replacements-in-lualatex
\documentclass[a4paper]{ltjsarticle}
\usepackage[no-math]{luatexja-fontspec}
\usepackage{luacode,luatexbase}
%\usepackage[callback={preline},verbosity=1]{nodetree}
%\usepackage{lipsum}
\usepackage[textwidth=32em,textheight=5cm,paperwidth=32em,paperheight=5cm]{geometry}
@k16shikano
k16shikano / toSnowman.hs
Last active September 17, 2020 11:02
圧縮解除した /ToUnicode を雑に本質に書き換える
{-# LANGUAGE OverloadedStrings #-}
module Main where
import System.Environment (getArgs)
import Data.Char (chr)
import Numeric (showHex, readHex)
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as B