Skip to content

Instantly share code, notes, and snippets.

# git
alias gs='git status'
alias gd='git diff'
alias ga='git add'
alias gb='git branch'
alias gl='git log'
alias glp='git log -p'
alias gcm='git commit -m'
alias gc='git checkout'
alias gst='git stash'
@regepan
regepan / .wp-env.json
Last active January 28, 2024 06:30
"core": "./_public",とすることで、localのWordPressをまるごと全部gitに入れられる。下手に隠蔽するより柔軟性が圧倒的に高い。PHPのバージョン変更可能。wp-cli使用可能。
{
"phpVersion": "7.4",
"core": "./_public",
"port": 8888
}
# cliのphpのバージョンを選択して切り替える
sudo update-alternatives --config php

# apache2のphpを無効化 & 有効化
sudo a2dismod php8.0 && sudo a2enmod php7.4

Ref.

apache2 使用するphpのバージョンを変更する

https://mebee.info/2021/08/02/post-29391/

Fast Node Manager (fnm)

Cross-platform support (macOS, Windows, Linux)

# Check installable node versions
$ fnm list-remote

# Install new node version
$ fnm install v18.16.0

絶対パス(absolute path)

<a href="https://github.com/hoge">XXX</a>

ルートパス(root path)

<a href="/hoge">XXX</a>
(function ($) {
})(jQuery);
@regepan
regepan / nodenv.md
Last active September 15, 2021 17:39

Migration

# Remove all data
$ php artisan migrate:fresh --seed
$ php artisan migrate
# Update table
$ php artisan make:migration add_votes_to_users_table --table=users
var hoge1;
var hoge2 = 1;

console.log("hoge1 =", typeof hoge1, typeof hoge1 === 'undefined'); // hoge1 = undefined true
console.log("hoge2 =", typeof hoge2, typeof hoge2 === 'undefined'); // hoge2 = number false
console.log("hoge3 =", typeof hoge3, typeof hoge3 === 'undefined'); // hoge3 = undefined true