This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| visudo | |
| # {username} ALL=NOPASSWD: AL | |
| sudo apt update | |
| sudo apt upgrade | |
| sudo apt install \ | |
| language-pack-ja-base language-pack-ja ibus-mozc \ | |
| zsh \ | |
| git \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setopt nonomatch | |
| alias ll='ls -al' | |
| alias windows='nkf -sLw --overwrite' | |
| alias linux='nkf -wLu --overwrite' | |
| alias emacs='emacs --no-windows' | |
| HISTFILE=$HOME/.zsh_history # 履歴をファイルに保存する | |
| HISTSIZE=100000 # メモリ内の履歴の数 | |
| SAVEHIST=100000 # 保存される履歴の数 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # zsh | |
| - https://wiki.archlinux.jp/index.php/Zsh#.E3.82.B5.E3.83.BC.E3.83.89.E3.83.91.E3.83.BC.E3.83.86.E3.82.A3.E6.8B.A1.E5.BC.B5 | |
| ## sheldon | |
| - https://github.com/rossmacarthur/sheldon | |
| - https://ryota2357.com/blog/2022/zsh-plugmanager-zplug-to-sheldon/ | |
| - https://ktrysmt.github.io/blog/migrate-zinit-to-sheldon/ | |
| - https://zenn.dev/ganta/articles/e1e0746136ce67 | |
| # asdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shell = 'zsh' | |
| [plugins.zsh-defer] | |
| github = 'romkatv/zsh-defer' | |
| apply = ['source'] | |
| [templates] | |
| defer = { value = 'zsh-defer source "{{ file }}"', each = true } | |
| [plugins.compinit] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Docker without Docker Desktop | |
| ## Docker without Docker Desktop for macOS | |
| - https://qiita.com/kyosuke5_20/items/cd5f3df4e827c34d7c4a | |
| ## Docker without Docker Desktop for Windows | |
| - https://qiita.com/ohtsuka1317/items/617a865b8a9d4fb67989 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # minikube | |
| - https://zenn.dev/gekal/articles/minikube-on-mac-as-local-k8s-env | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // see https://gist.github.com/2382341 | |
| // scalaz for only solution3 | |
| import scalaz._ | |
| import Scalaz._ | |
| object SolutionForMultiNestedMatchforMyStudy { | |
| def f(num: Int): Option[Int] = { | |
| num match { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def compute1(maybeFoo: Option[Foo]): Option[Int] = | |
| for { | |
| foo <- maybeFoo | |
| bar <- foo.bar | |
| baz <- bar.baz | |
| } yield baz.compute | |
| // for compute2 | |
| import scalaz._ | |
| import Scalaz._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object HexBytesUtil { | |
| def hex2bytes(hex: String): Array[Byte] = { | |
| hex.replaceAll("[^0-9A-Fa-f]", "").sliding(2, 2).toArray.map(Integer.parseInt(_, 16).toByte) | |
| } | |
| def bytes2hex(bytes: Array[Byte], sep: Option[String] = None): String = { | |
| sep match { | |
| case None => bytes.map("%02x".format(_)).mkString | |
| case _ => bytes.map("%02x".format(_)).mkString(sep.get) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object HexBytesUtil { | |
| def hex2bytes(hex: String): Array[Byte] = { | |
| if(hex.contains(" ")){ | |
| hex.split(" ").map(Integer.parseInt(_, 16).toByte) | |
| } else if(hex.contains("-")){ | |
| hex.split("-").map(Integer.parseInt(_, 16).toByte) | |
| } else { | |
| hex.sliding(2,2).toArray.map(Integer.parseInt(_, 16).toByte) | |
| } |
NewerOlder