Skip to content

Instantly share code, notes, and snippets.

View KisaragiEffective's full-sized avatar
🔇
sick

Kisaragi KisaragiEffective

🔇
sick
  • Some(_)
  • Hokkaido, Japan
View GitHub Profile
@KisaragiEffective
KisaragiEffective / GitHubActions.d.ts
Created June 14, 2020 06:26
GitHubActionsのjson型定義を書くのが面倒だったからTypeScriptで定義してみたら思ったよりも簡単に定義できた
/*
Copyright 2020 KisaragiEffective
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
@KisaragiEffective
KisaragiEffective / pictogram.d.ts
Last active June 7, 2020 04:36
type definition for pictogram
/*
Copyright 2020 KisaragiEffective
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
@KisaragiEffective
KisaragiEffective / setup_some_useful_commands.sh
Last active July 5, 2021 23:49
記憶喪失してまた一からubuntuを構築するとき用の保険
alias cls=clear
alias mkdirs="mkdir -r"
alias symlink="ln -sr"
sudo apt install -y curl neovim
# 日本語バイバイ
symlink ~/テンプレート ~/template
symlink ~/デスクトップ ~/desktop
symlink ~/ドキュメント ~/document
symlink ~/ビデオ ~/video

1: JavaはIntersection typeやUnion typeを(部分的に)サポートしている

Hoge & Piyo hogePiyo = (Hoge & Piyo) fuga;
// TはCloneableを実装していてSerializableも実装しているクラス
class Hoge<T extends Cloneable & Serializable> {
// ...
@KisaragiEffective
KisaragiEffective / CurryingOnKotlin.kts
Created May 13, 2020 21:42
ボイラーコードに、さよなら!w
// Currying on Kotlin
val s = " "
(2..22).forEach { c ->
val r = 1..c
val indent = s::repeat
val generic = r.joinToString(", ") { "E$it" }
val retLambda = r.joinToString(" -> ") { "(E$it)" } + " -> R"
val argument = r.joinToString(", ") { "e$it" }
val head = r.joinToString("\n") { indent(it+1) + indent(1).dropLast(1) + "{ e$it ->" }
.drop(s.length * 3 - 1)
import java.io.*
import java.net.HttpURLConnection
import java.net.URL
import java.nio.file.Files
import java.nio.file.Paths
import java.text.DecimalFormat
import java.util.*
import java.util.zip.ZipEntry
import java.util.zip.ZipInputStream
@KisaragiEffective
KisaragiEffective / 整地鯖の歩み.md
Last active November 8, 2020 11:50
せーちさばのれきし

1代目 (Unchama's MC server)

2代目 (Koron server)

  • 13/11/?? 運営開始

3代目 (旧整地鯖)

2015年

  • 2/2 運営開始
  • 利用者定義コマンドはCommandExecutorではなくCommandクラスを拡張すること
  • ItemStackはない
    • Item(int) or Item.get(int) or ItemXXX を触る
    • なぜわたしたちは3つの方法を持っていますか?
  • Materialはない
    • Enumって知ってる?
  • PlayerInterectEvent はBLOCKとAIRで2回呼ばれる
  • デフォルトではWi-Fiでないとサーバーに入れない
    • ggrksだが不親切
  • BEが悪い
import java.math.BigInteger as bigint
private fun solve() {
}
fun main(s: Array<String>) = solve()
fun String.toBigInteger() = bigint(this)
val gets: List<String>
機能 シングルバイト マルチバイト
大文字 strtoupper mb_strtoupper
小文字 strtolower mb_strtolower
長さ strlen mb_strlen