Skip to content

Instantly share code, notes, and snippets.

View mildronize's full-sized avatar

Thada Wangthammang mildronize

View GitHub Profile
@mildronize
mildronize / global-store.ts
Created November 8, 2020 17:33
Global store
export type Dictionary<T> = {
[key: string]: T;
};
export class GlobalStore {
static get(key: string) {
if (getGlobalStore().data === undefined)
getGlobalStore().data = {};
if (getGlobalStore().data[key] === undefined)
@mildronize
mildronize / README.md
Created November 9, 2020 06:30
Check if an Object is a Promise in JavaScript
@mildronize
mildronize / README.md
Created November 9, 2020 09:19
Typescript Design pattern
@mildronize
mildronize / README.md
Last active November 18, 2020 01:48
Git cheat sheet

Deleting local branches

git branch -a
# *master
#  test
#  remote/origin/master
#  remote/origin/test

git branch -d test
@mildronize
mildronize / README.md
Last active June 13, 2021 08:28
My VS Code settings & Extensions

Common

  • [Vim]
    • Disable CTRL+C and CTRL+V
    "vim.handleKeys": {
          "<C-c>": false,
          "<C-v>": false
      }
    
/*
* Legit auto pop by Noxturnix
* Version 0.3
*
* How to use:
* 1. Go to https://popcat.click/
* 2. Press F12
* 3. Go to "Console" tab
* 4. Ignore the warning. There's no such malicious codes in this script. You can try to understand the code if you want
* 5. Copy and paste this script
@mildronize
mildronize / secure-client.js
Created October 26, 2021 08:37 — forked from ceejbot/secure-client.js
A node https server/client pair that uses client certs to authorize clients.
#!/usr/bin/env node
var fs = require('fs'),
https = require('https');
// We pass our client key & cert to the http agent,
// which we then use to make the request.
var agentOptions = {
key: fs.readFileSync('client.key'),
cert: fs.readFileSync('client.crt'),
@mildronize
mildronize / Setup SSH keys.md
Last active November 20, 2021 08:43 — forked from my-wrm/README.md
Setup SSH keys for use with GitHub/GitLab/BitBucket etc

Create a new repository, or reuse an existing one.

Generate a new SSH key:

ssh-keygen -t rsa -C "your_email@example.com"

Copy the contents of the file ~/.ssh/id_rsa.pub to your SSH keys in your GitHub account settings (https://github.com/settings/keys).

Test SSH key: