Skip to content

Instantly share code, notes, and snippets.

@tlan16
tlan16 / 00-typescript-esm.md
Created November 8, 2023 00:48 — forked from slavafomin/00-typescript-esm.md
Using TypeScript with native ESM

Using TypeScript Node.js with native ESM

This reference guide shows how to configure a TypeScript Node.js project to work and compile to to native ESM.

Rationale

CommonJS module system was introduced by the Node.js developers due to the lack of the notion of "modules" in the original JavaScript (ECMAScript) language specification at that time. However, nowadays, ECMAScript has a standard module system called ESM — ECMAScript Modules, which is a part of the accepted standard. This way CommonJS could be considered vendor-specific and obsolete/legacy. Hopefully, TypeScript ecosystem now supports the "new" standard.

So the key benefits are:

@tlan16
tlan16 / bash_to_zsh_history.rb
Created October 28, 2023 05:07 — forked from goyalankit/bash_to_zsh_history.rb
Import bash history to zsh history.
#################################################################
# = This script transfers bash history to zsh history
# = Change bash and zsh history files, if you don't use defaults
#
# = Usage: ruby bash_to_zsh_history.rb
#
# = Author: Ankit Goyal
#################################################################
# change if you don't use default values
{
"ver":"5.0",
"tag":"hipsuser",
"data":[
{
"id":1,
"power":1,
"name":"[结束]勒索行为防护.A.00",
"procname":"*",
"treatment":1,
{"type":"Metric","data":{"name":"http_reqs","type":"counter","contains":"default","tainted":null,"thresholds":[],"submetrics":null,"sub":{"name":"","parent":"","suffix":"","tags":null}},"metric":"http_reqs"}
{"type":"Point","data":{"time":"2021-11-24T22:20:41.781881725+11:00","value":1,"tags":{"cloud_host":"https://localhost:9200","cloud_id":"LOCAL.OCIS","cloud_vendor":"ocis","expected_response":"true","group":"","issue_url":"github.com/owncloud/ocis/issues/1399","method":"MKCOL","name":"https://localhost:9200/remote.php/dav/files/admin/VU-1-ITER-0-I-0","play":"cloud_default_play_dav_create","proto":"HTTP/1.1","scenario":"default","status":"201","test_id":"propfind-deep-rename","tls_version":"tls1.3","url":"https://localhost:9200/remote.php/dav/files/admin/VU-1-ITER-0-I-0"}},"metric":"http_reqs"}
{"type":"Metric","data":{"name":"http_req_duration","type":"trend","contains":"time","tainted":null,"thresholds":[],"submetrics":null,"sub":{"name":"","parent":"","suffix":"","tags":null}},"metric":"http_req_duration
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 17 columns, instead of 11. in line 3.
timestamp,value,cloud_host,cloud_id,cloud_vendor,expected_response,group,issue_url,method,name,play,proto,scenario,status,test_id,tls_version,url
2021-11-25T00:01:15.221Z,1,https://localhost:9200,LOCAL.OCIS,ocis,true,,github.com/owncloud/ocis/issues/1399,MKCOL,https://localhost:9200/remote.php/dav/files/admin/VU-1-ITER-0-I-0,cloud_default_play_dav_create,HTTP/1.1,default,201,propfind-deep-rename,tls1.3,https://localhost:9200/remote.php/dav/files/admin/VU-1-ITER-0-I-0
2021-11-25T00:01:15.221Z,316.495711,https://localhost:9200,LOCAL.OCIS,ocis,true,,github.com/owncloud/ocis/issues/1399,MKCOL,https://localhost:9200/remote.php/dav/files/admin/VU-1-ITER-0-I-0,cloud_default_play_dav_create,HTTP/1.1,default,201,propfind-deep-rename,tls1.3,https://localhost:9200/remote.php/dav/files/admin/VU-1-ITER-0-I-0
2021-11-25T00:01:15.221Z,2.666958,https://localhost:9200,LOCAL.OCIS,ocis,true,,github.com/owncloud/ocis/issues/1399,MKCOL,https://localhost:9200/remote.php/dav/files/admin/VU-1-ITER-0-I-0,cloud_default_play_dav_create
no-csp-reports: * true
no-large-media: behind-the-scene false
no-scripting: * true
no-scripting: www.12349.net false
no-scripting: 127.0.0.1 false
no-scripting: 13.54.173.171 false
no-scripting: www.1337x.to false
no-scripting: www.1377x.to false
no-scripting: 192.168.0.1 false
no-scripting: 192.168.0.15 false
info: reading kernel config from /boot/config-5.10.52-gentoo ...
Generally Necessary:
- cgroup hierarchy: properly mounted [/sys/fs/cgroup]
- CONFIG_NAMESPACES: enabled
- CONFIG_NET_NS: enabled
- CONFIG_PID_NS: enabled
- CONFIG_IPC_NS: enabled
- CONFIG_UTS_NS: enabled
- CONFIG_CGROUPS: enabled
@tlan16
tlan16 / iTerm2_Keys.itermkeymap
Last active July 2, 2021 12:43
iTerm2_Keys.itermkeymap
{"Key Mappings":{"0xf700-0x300000-0x0":{"Label":"","Action":7,"Text":""},"0xf72c-0x20000-0x0":{"Label":"","Action":9,"Text":""},"0xf72d-0x100000-0x0":{"Label":"","Action":8,"Text":""},"0xf703-0x320000-0x0":{"Label":"","Action":34,"Text":""},"0xf72b-0x100000-0x0":{"Label":"","Action":4,"Text":""},"0x56-0x60000-0x9":{"Label":"","Action":41,"Text":"{\"ConvertUnicodePunctuation\":true,\"WaitForPrompts\":false,\"Substitution\":\"\",\"EscapeForShell\":false,\"Base64\":false,\"TabStopSize\":4,\"Delay\":0.01,\"RemoveNewlines\":false,\"Regex\":\"\",\"ConvertNewlines\":true,\"TabTransform\":0,\"BracketAllowed\":true,\"UseRegexSubstitution\":false,\"ChunkSize\":1024,\"RemoveControls\":true}"},"0x9-0x40000-0x0":{"Label":"","Action":32,"Text":""},"0xf72d-0x40000-0x0":{"Label":"","Action":0,"Text":""},"0xf72d-0x20000-0x0":{"Label":"","Action":8,"Text":""},"0xf72c-0x100000-0x0":{"Label":"","Action":9,"Text":""},"0xf701-0x300000-0x0":{"Label":"","Action":6,"Text":""},"0xf702-0x320000-0x0":{"Label":"","Action":33,"Text":""},"
@tlan16
tlan16 / iTerm2_profile.json
Created March 14, 2021 21:37
iTerm2_profile.json
{
"Ansi 2 Color" : {
"Green Component" : 0.73333334922790527,
"Red Component" : 0,
"Blue Component" : 0
},
"Tags" : [
],
"Ansi 12 Color" : {
@tlan16
tlan16 / karabiner.json
Last active July 2, 2021 14:13
~/.config/karabiner/karabiner.json
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {