Skip to content

Instantly share code, notes, and snippets.

var arr = [];
for (var i = 1; i <4 ; i++) {
arr.push(function(j) {
return function() {console.log(j);}
}(i));
}
arr[0]();
arr[1]();
arr[2]();
@tingwei628
tingwei628 / checklist.md
Created March 16, 2024 05:54
checklist
@tingwei628
tingwei628 / x.md
Last active January 27, 2024 15:25
cloudflare tunnel

install cloudflared

cloudflared.exe service install [token]

stop cloudflared

sc stop cloudflared

start cloudflared

sc start cloudflared

@tingwei628
tingwei628 / docker-compose.yml
Created October 27, 2019 15:20
use postgresql and pgAdmin in docker
version: "3.4"
services:
pgAdmin:
restart: always
image: dpage/pgadmin4
ports:
- "8000:80"
environment:
PGADMIN_DEFAULT_EMAIL: 1234@admin.com
@tingwei628
tingwei628 / readme.txt
Created July 8, 2023 14:58
TCP 是怎樣工作的
Repo: https://github.com/ituring/tcp-book
環境建立:
Mobaxterm 登入 vagrant ssh guest1 問題
參考
https://stackoverflow.com/a/68515228
@tingwei628
tingwei628 / abort_request.js
Last active August 21, 2022 15:24
abort xhr request
var xhr = new XMLHttpRequest(),
method = "your_api_method",
url = "you_api";
xhr.open(method, url, true);
xhr.send();
setTimeout(() => {
xhr.abort();
}, 1000)
@tingwei628
tingwei628 / mongoDB.md
Last active June 25, 2022 19:03
mongoDB
@tingwei628
tingwei628 / mysql.md
Last active June 18, 2022 05:40
mysql
  • install mysql brew install mysql
  • start mysql brew services start mysql
  • stop mysql brew services stop mysql
  • server localhost, port 3306, user root