Access Oracle Cloud VM from any browser on any devices
wget -O vscode.deb https://code.visualstudio.com/sha/download\?build\=stable\&os\=linux-deb-arm64 && sudo apt install ./vscode.deb --fix-broken -y && rm vscode.deb
Access Oracle Cloud VM from any browser on any devices
wget -O vscode.deb https://code.visualstudio.com/sha/download\?build\=stable\&os\=linux-deb-arm64 && sudo apt install ./vscode.deb --fix-broken -y && rm vscode.deb
一個傳統 Java Spring 的應用程式會分為三層 @Controller
@Service
@Repository
,然後依據組織需求,再往下細分。
比方說 Service 層複雜的話,會增加 Gateway、Facade 層,或是我們組織獨有的 CoreService 層
另一個層級大部份 Java 組織會忽略的是 Domain Model 層,絕大多數 Java 開發者會開個 entity 或 model package,然後 將所有的 Entity 往裡面丟。然而該 Entity 只是一堆欄位和 getter/setter 的堆疊,也就是單純的 Table 的對應物件而已, 不具備任何 business logic
$ brew install podman
# This goes in your Microsoft.PowerShell_profile.ps1 (can find the path via $PROFILE in your prompt) | |
Import-Module -Name posh-git,oh-my-posh,Terminal-Icons | |
Set-PoshPrompt -Theme craver |
#cloud-config | |
package_upgrade: true | |
ssh_authorized_keys: | |
- <your key> | |
packages: | |
- apt-transport-https | |
- ca-certificates | |
- curl |
/** | |
* Postman Pre-Request script to append CSRF token in header for POST requests in Laravel | |
* Sanctum authenticated SPA. Requires active environment with {{url}} variable defined | |
* for main app domain. | |
* | |
* Postman Interceptor allows appending cookies from browser, but Laravel CSRF middleware | |
* only validates CSRF in headers or in _token form field, not in cookies. Axios automatically | |
* appends the CSRF from cookie to headers, but Postman cannot access intercepted cookies | |
* and use them, so we have to do one pre-request to get the CSRF token, store it | |
* in environment so it can be reused, and then append it to headers. |
# https://www.cyberciti.biz/faq/apple-mac-osx-terminal-color-ls-output-option/ | |
export CLICOLOR=1 | |
export EDITOR=vi | |
# https://learn.microsoft.com/dotnet/core/tools/dotnet-environment-variables#dotnet_cli_ui_language | |
export DOTNET_CLI_UI_LANGUAGE='en-us' | |
# https://learn.microsoft.com/aspnet/core/fundamentals/environments | |
export DOTNET_ENVIRONMENT=Development | |
export ASPNETCORE_ENVIRONMENT=Development |
#!/bin/bash | |
CONFIG_PATH=~/.config/Code | |
for i in $CONFIG_PATH/User/workspaceStorage/*; do | |
if [ -f $i/workspace.json ]; then | |
folder="$(python3 -c "import sys, json; print(json.load(open(sys.argv[1], 'r'))['folder'])" $i/workspace.json 2>/dev/null | sed 's#^file://##;s/+/ /g;s/%\(..\)/\\x\1/g;')" | |
if [ -n "$folder" ] && [ ! -d "$folder" ]; then | |
echo "Removing workspace $(basename $i) for deleted folder $folder of size $(du -sh $i|cut -f1)" |
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\directory\background\shell\git_fork] | |
@="Open in &Fork" | |
"Icon"=hex(2):25,00,4c,00,4f,00,43,00,41,00,4c,00,41,00,50,00,50,00,44,00,41,\ | |
00,54,00,41,00,25,00,5c,00,46,00,6f,00,72,00,6b,00,5c,00,46,00,6f,00,72,00,\ | |
6b,00,2e,00,65,00,78,00,65,00,2c,00,30,00,00,00 | |
[HKEY_CLASSES_ROOT\directory\background\shell\git_fork\command] | |
@=hex(2):22,00,25,00,4c,00,4f,00,43,00,41,00,4c,00,41,00,50,00,50,00,44,00,41,\ |
# This is based on https://github.com/security-code-scan/security-code-scan/blob/master/SecurityCodeScan/Config/Main.yml | |
# IMPORTANT: YML is very strict about indentation and white spaces | |
Version: 2.1 | |
# Set to 'true' to see more warnings | |
AuditMode: false | |
# Allows to define custom anti CSRF attributes and conditions |