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
unbind C-b | |
set -g prefix C-a | |
bind C-a send-prefix | |
# Shift arrow to resize pane | |
bind -n S-Down resize-pane -D 5 | |
bind -n S-Up resize-pane -U 5 | |
bind -n S-Left resize-pane -L 5 | |
bind -n S-Right resize-pane -R 5 |
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
set nocompatible | |
set number | |
set mouse=a | |
" gitgutter 更新時間縮短 | |
set updatetime=200 | |
set backspace=2 | |
set expandtab | |
set tabstop=4 | |
set shiftwidth=4 | |
set nu |
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
version: '3.5' | |
services: | |
nginx-proxy: | |
image: jwilder/nginx-proxy | |
container_name: nginx-proxy | |
ports: | |
- "80:80" | |
volumes: | |
- /var/run/docker.sock:/tmp/docker.sock:ro |
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
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH |
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
#!/bin/bash | |
usage() | |
{ | |
echo "" | |
echo "Usage: $0 [ -d ][ -p ] " | |
echo -e "\t-d desired docker disk path" | |
echo -e "\t-p desired project path" | |
} |
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
// ref: | |
// https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Object/assign | |
// https://medium.com/@jobboy0101/js%E5%9F%BA%E7%A4%8E-primitive-type-v-s-object-types-f88f7c16f225 | |
let a = { | |
pro1: 'aaa', | |
pro2: { | |
pro22: 'aaaa' | |
} | |
}; |
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 recursion = n => { | |
if (n === 0) return 0; | |
if (n === 1) return 1; | |
return recursion(n - 1) + recursion(n - 2); | |
}; | |
const iteration = n => { | |
if (n === 0) return 0; | |
if (n === 1) return 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
#!/bin/sh | |
parse_git_branch() { | |
git branch -a | sed -e "/^[^*]/d" -e "s/* \(.*\)/ $(echo '\033[1;31m')\1/" | |
} | |
echo $(parse_git_branch) |
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 ldapjs = require('ldapjs'); | |
const url = process.env.LDAP_URL; | |
const LDAP_BIND_DN = process.env.LDAP_BIND_DN; | |
const LDAP_BIND_PWD = process.env.LDAP_BIND_PWD; | |
const SEARCH_DN = process.env.SEARCH_DN; | |
module.exports = (() => { | |
let client; |
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
// Imagine we have an array of 10000 promises, | |
// How do we process them one by one ? | |
// Here is a general version g and a recursive version r | |
let input = []; | |
for (let i = 1; i <= 10000; i++) { | |
input.push(Promise.resolve(i)); | |
} |
OlderNewer