Skip to content

Instantly share code, notes, and snippets.

View na4zagin3's full-sized avatar

Sakamoto Noriaki na4zagin3

View GitHub Profile
// Install SATySFi 0.1.0~alpha+2022.09.19 in a new OPAM switch created at the current directory
opsm switch create .
opam repository add satysfi-external https://github.com/gfngfn/satysfi-external-repo.git
opam repository add satyrographos https://github.com/na4zagin3/satyrographos-repo.git
opam repository add satyrographos-alpha https://github.com/na4zagin3/satyrographos-repo-alpha.git
opam install satysfi.0.1.0~alpha+2022.09.19
// Remove the current switch at the current directory
opam switch remove .
@na4zagin3
na4zagin3 / KeyCapsBlack.scad
Created June 27, 2021 04:50
Arturia Keystep Janko Layout Packer
intv = 30;
total = 25;
rows = 5;
translate([80,45,0])
for (i=[0:29]) {
idx = i % rows;
cyc = (i - idx) / rows;
ofs = cyc * total;
translate([idx * intv + ((cyc % 2) * intv / 2), ofs, 0])
@na4zagin3
na4zagin3 / autogen-examples.saty
Last active March 22, 2020 16:31
SATySFi: lists of installed packages and fonts
% Commands:
% $ satyrographos install -a '%fonts' -a '%libraries'
% $ satysfi autogen-examples.saty
%
% Note:
% You could use `-system-font-prefix 'system:'` as follows, which probably makes SATySFi fail due to unsupported features.
% $ satyrographos install -a '%fonts' -a '%libraries' -system-font-prefix 'system:'
@require: stdjabook
@require: math
@na4zagin3
na4zagin3 / T1.scala
Last active February 2, 2019 15:07 — forked from kmizu/T1.scala
Write instances of Ordering[T] manually
sealed abstract class T1
object T1 {
case class A(x: Int) extends T1
case class B(x: Double) extends T1
case class C(x: String) extends T1
implicit val ordA: Ordering[A] = (a, b) => a.x compare b.x
implicit val ordB: Ordering[B] = (a, b) => a.x compare b.x
implicit val ordC: Ordering[C] = (a, b) => a.x compare b.x
}
-- references:
-- The Book of Numbers, J. H. Conway and R. K. Guy, New York: Springer-Verlag, 1996, pp. 15–16. ISBN 0-387-97993-X.
import Data.Tuple
import Data.List
unfoldBase :: (Integral a)=> a -> a -> [a]
unfoldBase b = unfoldr (\ x -> if x == 0 then Nothing else Just (swap $ quotRem x b))
onesPlace :: (Integral a)=> a -> [String]
@na4zagin3
na4zagin3 / gist:4142875
Created November 25, 2012 08:57
trachet が落ちた時のスタックトレース
# pip でインストールした trachet 0.0.7 です。
# 起動時のコマンドラインは
# $ trachet -o /dev/pts/27 bash
# で、emacs 上でのアラビア語入力のテストを終えた後落ちました。
# 落ちた時の入力はたぶん「 <cr> <esc> : w q <nl> 」で、どこで落ちたかはわかりません。
Traceback (most recent call last):
File "/usr/bin/trachet", line 9, in <module>
load_entry_point('trachet==0.0.7', 'console_scripts', 'trachet')()