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
if [[ -n $(echo ${^fpath}/chpwd_recent_dirs(N)) && -n $(echo ${^fpath}/cdr(N)) ]]; then | |
autoload -Uz chpwd_recent_dirs cdr add-zsh-hook | |
add-zsh-hook chpwd chpwd_recent_dirs | |
zstyle ':completion:*' recent-dirs-insert both | |
zstyle ':chpwd:*' recent-dirs-default true | |
zstyle ':chpwd:*' recent-dirs-max 1000 | |
zstyle ':chpwd:*' recent-dirs-file "$HOME/.cache/chpwd-recent-dirs" | |
fi |
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
function fzf-src(){ | |
local src=$(ghq list --full-path | fzf --query "$LBUFFER" --layout=reverse) | |
if [ -n "$src" ]; then | |
BUFFER="cd $src" | |
zle accept-line | |
fi | |
zle -R -c | |
} | |
zle -N fzf-src | |
bindkey '^]' fzf-src |
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
HIST_STAMPS="yyyy-mm-dd" | |
# fzf history | |
function fzf-select-history() { | |
local selected=$(history -n -r 1 | fzf --query "$LBUFFER" --reverse) | |
if [ -n "$selected" ]; then | |
BUFFER=$(echo "$selected" | awk '{$1=""; $2=""; print $0}' | sed 's/^[ \t]*//') | |
CURSOR=$#BUFFER | |
zle reset-prompt | |
fi |
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
CLUSTER_NAME=$YOUR_CLUSTER_NAME | |
TASK_DEF_NAME=$YOUR_TASK_NAME | |
SERVICE_NAME=$YOUR_SERVICE_NAME | |
task_arn=$(aws ecs list-task-definitions --family-prefix "$TASK_DEF_NAME" --query "reverse(taskDefinitionArns)[0]" --output text) | |
# Describe the ECS service to get network configuration details | |
network_config=$(aws ecs describe-services --cluster $CLUSTER_NAME --services $SERVICE_NAME --query 'services[0].networkConfiguration.awsvpcConfiguration' --output json) | |
# Extract subnets and security groups |
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
[alias] | |
clean-branch = !git fetch -p | git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D |
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
git config --global init.defaultBranch main |
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
class Solution: | |
def twoSum(self, nums: List[int], target: int) -> List[int]: | |
for i1, num1 in enumerate(nums): | |
for i2, num2 in enumerate(nums[i1+1:]): | |
if target == (num1 + num2): | |
return [i1, i2 + i1 + 1] |
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
class AwsLambdaClient { | |
val aws_access_key_id = "<YOUR_ACCESS_KEY_PASTE_HERE>" | |
val aws_secret_access_key = "<YOUR_SECRET_KEY_PASTE_HERE>" | |
val region = "ap-northeast-1" | |
val function_name = "test_func" | |
fun invoke() { | |
val payload = """ | |
{ | |
"token": "TOKEN", |
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
import sys | |
sys.path.append(path.normpath(path.join(path.dirname(path.abspath( __file__ )), '..'))) |
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
function deleteOldMail() { | |
var sheet = SpreadsheetApp.getActive().getSheetByName('label'); | |
for(var row=2; row<=sheet.getLastRow(); row++){ | |
var labelName = sheet.getRange(row, 1).getValue(); | |
var days = sheet.getRange(row, 2).getValue(); | |
var deleteThreads = GmailApp.search('older_than:'+days+'d -is:starred label:'+ labelName); | |
for (var i = 0; i < deleteThreads.length; i++) { | |
deleteThreads[i].moveToTrash(); | |
} |
NewerOlder