This file contains 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
# Append in ~/.direnvrc below: | |
use_node() { | |
layout node | |
local node_version=$1 | |
if [ "$node_version" == "package.json" ]; then | |
# Requires jq: `brew install jq` | |
if ! command -v jq &> /dev/null; then | |
echo -e "\033[0;31mjq is not installed. Please type 'brew install jq'.\033[0m" |
This file contains 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
# Use ko_KR.utf8 for lower version of Postgres | |
# ex: select * from sample_table order by "name" COLLATE "ko-KR-x-icu"; | |
ko_name = Func("name", function="ko-KR-x-icu", template='(%(expressions)s) COLLATE "%(function)s"') | |
queryset = queryset.order_by(ko_name.asc()) |
This file contains 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
brew install duti python-yq | |
curl "https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml" \ | |
| yq -r "to_entries | (map(.value.extensions) | flatten) - [null] | unique | .[]" \ | |
| xargs -L 1 -I "{}" duti -s com.microsoft.VSCode {} all | |
# Use duti to set defaults for specific files to VSCode | |
duti -s com.microsoft.VSCode public.plain-text all | |
duti -s com.microsoft.VSCode public.source-code all | |
duti -s com.microsoft.VSCode public.data all |
This file contains 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
const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; |
This file contains 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
@layer utilities { | |
/* extra helper classes for iphone safe areas */ | |
.safe-p { | |
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); | |
} | |
.safe-px { | |
padding-left: env(safe-area-inset-left); | |
padding-right: env(safe-area-inset-right); | |
} | |
.safe-py { |
My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
This file contains 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
defaults write com.apple.screencapture location $HOME/Library/Mobile\ Documents/com~apple~CloudDocs/Documents/Screenshots |
This file contains 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
/** | |
* @desc It triggers mouse event. | |
* @param {HTMLElement} element target DOM element | |
* @param {string} type type of event | |
* @param {number} x clientX of event | |
* @param {number} y clientY of event | |
*/ | |
export function simulateEvent(element, type, x, y) { | |
const mouseEvent = new MouseEvent(type, { | |
screenX: 0, |
NewerOlder