Skip to content

Instantly share code, notes, and snippets.

@simics-ja
simics-ja / memo.sh
Last active March 22, 2022 00:49
[ちょいスクリプト] #zsh #shell
#!/bin/zsh
MEMO_DIR=$HOME/memofiles
mkdir -p $MEMO_DIR 2>/dev/null
local -A opthash
zparseopts -D -A opthash -- c: d l
# cot is installed in /usr/local/bin/
@simics-ja
simics-ja / starship.toml
Last active June 23, 2022 02:41
starship設定
# Use custom format
format = """
$username[@](bold black)$hostname$directory$git_branch$git_commit$git_state$git_metrics $git_status $time
[](bold cyan)[ ](bold purple)"""
scan_timeout=50
command_timeout=1500
[username]
disabled = false
@simics-ja
simics-ja / config.md
Created January 11, 2022 02:09
[vim備忘録] #vim

カスタマイズを無効化して起動

vim -u NONE -N
@simics-ja
simics-ja / Iterator-usage.md
Last active December 6, 2021 05:44
[PHPデザインパターン] 参考サイト:https://www.ritolab.com/category/PHP/DesignPatterns #php #design

Iterator

アンチパターン

以下のようなクラスからUserList取得してforeachで回すパターンは、Userのフィールドを増やそうとしたときに、メソッドの追加やテストが必要になったりする。 大規模なコードを変更するときには、この実装では変更箇所やテストが多く発生するため、これを最初に抑えるデザインパターンがIteratorパターンである。

class User
{
@simics-ja
simics-ja / one_liner.md
Created November 16, 2021 05:44
[ワンライナー収集] #shell

ランダム選出

shuf -n1 -e a b c d e f g
@simics-ja
simics-ja / 00-overview.md
Last active October 5, 2021 07:51
[grepコマンド] #grep #shell

ファイル中の文字列を部分一致で検索するのが基本的な使い方

grep <string> <path|file>

例えば、filedir以下からorangeを含むテキストを見つけるには以下のようにする

grep orange filedir/*
@simics-ja
simics-ja / fish-startup.md
Last active January 17, 2022 06:05
[fishとStarshipでおしゃれシェル環境構築] #fish #環境構築

前提

WSL環境であればbrewを入れること

https://brew.sh/

Ubuntuであれば

sudo apt install build-essential procps curl file git
@simics-ja
simics-ja / curl.md
Created June 23, 2021 01:27
[curl] #shell # curl

リクエスト内容も表示する

-vオプションをつける

$ curl -v google.co.jp                                            
*   Trying 172.217.175.99...
* TCP_NODELAY set
* Connected to google.co.jp (172.217.175.99) port 80 (#0)
> GET / HTTP/1.1
@simics-ja
simics-ja / karabinerの設定.md
Last active May 2, 2024 13:55
[Niz Atom 66 キーボード設定メモ] めっちゃ分かりにくいのでメモ

基本的にMacにWindowsキーボードとして認識させ,karabinerでうまいこと割り当てて運用する.

Traget Deviceを

  • Niz BT5.0(Nordic): 一度有線接続したことがある場合
  • Unknown(Nordic): 有線接続したことがない場合

として,以下の設定を行う

  • left_command -> left_option
@simics-ja
simics-ja / memo.md
Created May 20, 2021 12:32
[Svelte備忘録] 雑にまとめていく #JavaScript # Svelte

Svelte備忘録