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 / binary-parser-simple.rs
Created November 18, 2016 14:44
fbxcelのテストコード
extern crate env_logger;
extern crate fbxcel;
use std::fs::File;
use std::io::BufReader;
use std::path::Path;
#[test]
fn test_binary_parser() {
@lo48576
lo48576 / config-cwm
Last active June 26, 2017 09:44
かーねるこんふぃぐ生成
# Desktop.
#
# Basic settings (common)
#
# See https://wiki.gentoo.org/wiki/Kernel/Configuration .
# Modules.
## config FIRMWARE_IN_KERNEL
## bool "Include in-kernel firmware blobs in kernel binary"
FIRMWARE_IN_KERNEL=y
## menuconfig MODULES
@lo48576
lo48576 / ftdetect__ssh_known_hosts.vim
Last active January 18, 2023 10:43
Vim syntax highlight for `~/.ssh/known_hosts`
au BufRead,BufNewFile known_hosts,ssh_known_hosts set filetype=ssh_known_hosts
ファイルシステム データ源 ファイルを読むとき返ってくる値 ファイルに書くとき起きること

ext4

バイナリデータ

バイナリデータの適当な場所からデータを拾ってきて返す

バイナリデータの適当な場所にデータを書く、ジャーナルを書く、場合によっては領域確保のため管理領域に変更を加える

sshfs

SSH でログインできるリモートユーザ

ssh 経由でデータを読んだとき読まれる値

ssh 経由でデータを書き込む

@lo48576
lo48576 / iri.rs
Last active August 28, 2017 10:51
IRI in Rust
//! IRI types.
// This implementation is based on `str`, `String`, `std::str` and `std::path`
// on rust-1.19.0 .
// See:
//
// * https://github.com/rust-lang/rust/blob/1.19.0/src/libcore/str/mod.rs
// * https://github.com/rust-lang/rust/blob/1.19.0/src/libcollections/string.rs
// * https://github.com/rust-lang/rust/blob/1.19.0/src/libstd/path.rs
use std::borrow::{Borrow, ToOwned, Cow};
@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:
@lo48576
lo48576 / never-type-coercion.md
Last active December 7, 2017 13:54
Rust での発散と型推論とセミコロンあたりの挙動について、疑問と答えと経緯の調査。そのうちブログにまとめる予定の話のメモ。

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

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

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

更新

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

@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 / 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 / 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.