REMOTE_ADDR = Proxy IP
HTTP_VIA = Proxy IP
HTTP_X_FORWARDED_FOR = Your IP REMOTE_ADDR = proxy IP
HTTP_VIA = proxy IP| /* | |
| * @Description: Use JS to get notes from future in console(brwoser). | |
| * @Date: 2018-10-18 02:28 | |
| * @Author: undefined | |
| */ | |
| /*中文說明 | |
| 此程式必須要在voicetube的口說挑戰網頁並且已經是登入狀態才能運作,記得根據實際需求改寫開始和結束日期 | |
| * startDate = '2018-10-19'; | |
| * endDate = '2018-10-20'; |
| #!/bin/bash | |
| local_path='Your local path' # ex: /home/your_projects/test | |
| remote_path='Your cloud path' # ex: /var/www/api | |
| remote_con='Your ssh connection' # ex: [email protected] | |
| # Get the content in 'src/', because I only need to upload the content of 'src/' folder. | |
| for file in $(git status --porcelain | grep "src/") | |
| do | |
| file_name=${file/'^M$'/} # Get to a Modified file. | |
| local_file="$local_path$file_name" | |
| remote_file="$remote_path$file_name" |
| // 根據預設排序列表順序的方式把文字轉換成排序的優先序 | |
| let positions = ['總經理', '副總', '部長', '主任', '員工']; | |
| let staffs = [ | |
| { | |
| 'name': '員工1', | |
| 'position': '員工' | |
| }, | |
| { | |
| 'name': '大明', | |
| 'position': '總經理' |
| db.getCollection('logs').aggregate([ | |
| { | |
| '$match': { | |
| 'number': 0 | |
| } | |
| }, | |
| { | |
| '$group': { | |
| '_id' : {'id': '$id'}, | |
| 'items': { |
| <?php | |
| /** | |
| * Design Pattern of the Singleton. | |
| */ | |
| class Singleton | |
| { | |
| private static $instance = null; | |
| /** | |
| * Call this method to get singleton | |
| * |
| // Reference: https://codepen.io/macmladen/pen/XBwgEa/ | |
| let arr = [1, 2, 3, 4, 5, 1, 2 ,3, 4, 5]; | |
| // Set, this is a simple and plain method. | |
| [...new Set(arr)]; | |
| // filter, a built-in method based on the filter function. | |
| arr.filter((item, index) => arr.indexOf(item) === index); | |
| // Retrieve the duplicate values | |
| arr.filter((item, index) => arr.indexOf(item) !== index); |
| const testOne = { | |
| 'attr': 'origin', | |
| } | |
| testTwo = Object.create(testOne); // This is a testOne's inheritance. | |
| console.log(testTwo.attr); | |
| delete testTwo.attr; | |
| console.log(testTwo.attr); // To show 'origin', because this prototype of testTwo is testOne. |
| version: '3' | |
| services: | |
| nginx: | |
| container_name: nginx-container | |
| hostname: nginx-flask | |
| build: | |
| context: ./nginx | |
| dockerfile: Dockerfile | |
| restart: always |
| # Docker run. | |
| docker run -v $(pwd)/app/libs:/var/task/libs --rm -d -t <name space>/<container's name>:<tag's name, default:latest> | |
| # 執行特定docker's container by name. | |
| docker exec -it $(docker ps -f name=fb_related_pages -q) sh -c "<command something...>" | |
| # 過濾取得特定docker container inspect | |
| docker inspect $(docker ps -f name=<your container's name> -q) | |
| # 刪除volumes |