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 / 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 / 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
@tingwei628
tingwei628 / mongoDB.md
Last active June 25, 2022 19:03
mongoDB
@tingwei628
tingwei628 / How_to_run_Redis_server_and_Postgres_server_on_Replit.md
Last active May 4, 2022 06:09
How to run Redis server and Postgres server on Replit

Before starting, make sure to install pkg in replit.nix

{ pkgs }: {
    deps = [

        pkgs.postgresql
        pkgs.redis
    ];
}