Skip to content

Instantly share code, notes, and snippets.

View shun-shobon's full-sized avatar
🙇‍♂️
I'm sorry I'm not good at English.

NISHIZAWA Shuntaro shun-shobon

🙇‍♂️
I'm sorry I'm not good at English.
View GitHub Profile
@shun-shobon
shun-shobon / template.tex
Last active February 4, 2024 15:19
TeXのテンプレート.LuaLaTeX前提ですがちょっといじればupLaTeXとかでも使えると思います.
% クラスファイルを指定
% jlreqはW3Cで勧告されている日本語組版処理の要件を満たすクラスファイル
% jarticle, jreport, jbookなどは古い上に日本語組版処理の要件を満たしていないため使わない
\documentclass[
% LuaLaTeXを使う
luatex,
% 用紙サイズをA4にする
paper=a4paper,
% 欧文のフォントサイズを11ptにする
fontsize=11pt,
@shun-shobon
shun-shobon / global.css.ts
Created December 21, 2023 02:36
Reset CSS for vanilla-extract.
import "./layers.css";
import "./reset.css";
@shun-shobon
shun-shobon / intot.rs
Created September 7, 2023 09:32
Into with turbofish
trait IntoT {
fn intot<Dst>(self) -> Dst
where
Self: Into<Dst>;
}
impl<T> IntoT for T {
#[inline]
fn intot<Dst>(self) -> Dst
where
@shun-shobon
shun-shobon / noise.svg
Last active July 16, 2023 04:35
Paper like noise
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shun-shobon
shun-shobon / pipe.ts
Created December 27, 2022 17:07
オーバーロード無しでfp-ts風のpipe関数を実装
type Fn<T, U> = (_: T) => U;
type TopFn = Fn<never, unknown>;
type TopFns = ReadonlyArray<TopFn>;
type AssertPipeFns<Arg, Fns extends TopFns> = Fns extends [] ? true
: Fns extends [
infer HeadFn extends TopFn,
...infer RestFn extends TopFns,
] ? HeadFn extends Fn<Arg, infer NextArg> ? AssertPipeFns<NextArg, RestFn>
: false
curl -H "Accept: application/vnd.github+json" https://api.github.com/licenses/mit | jq -r .body | sed -e "s/\[year\]/$(date '+%Y')/; s/\[fullname\]/$(git config user.name)/" > LICENSE
@shun-shobon
shun-shobon / cloudflare-ddns.ps1
Created July 29, 2022 06:43
DDNS Cloudflare for PowerShell
$dns_record = "<Write Here>"
$ttl = 120
$cloudflare_zoneid = "<Write Here>"
$cloudflare_api_token = "<Write Here>"
$log_filename = "ddns.log"
$log_file = "$PSScriptRoot\$log_filename"
Write-Output "INFO [$(Get-Date)] 更新処理を開始します。" | Tee-Object $log_file -Append
@shun-shobon
shun-shobon / README.md
Last active June 16, 2022 06:57
glpngのmacOS対応スクリプト

glpng

説明

このシェルスクリプトはglpngをmacOS向けにコンパイルするためのパッチを当てるスクリプトです.

使い方

次のコマンドを入力すれば,glpng/にライブラリが生成されます.

@shun-shobon
shun-shobon / main.lua
Last active March 17, 2022 02:46
Interactions Recipe Calculator
local recipes = require("recipes")
local function calc_materials(name, amount, surpluses)
local target = recipes[name]
if target == nil then
return { [name] = amount }
end
local surplus = surpluses[name] or 0
@shun-shobon
shun-shobon / README.md
Last active November 11, 2021 15:30
Type-level range on TypeScript