Skip to content

Instantly share code, notes, and snippets.

Avatar

Thada Wangthammang mildronize

View GitHub Profile
@mildronize
mildronize / Setup SSH keys.md
Last active Nov 20, 2021 — forked from my-wrm/README.md
Setup SSH keys for use with GitHub/GitLab/BitBucket etc
View Setup SSH keys.md

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:

@mildronize
mildronize / secure-client.js
Created Oct 26, 2021 — forked from ceejbot/secure-client.js
A node https server/client pair that uses client certs to authorize clients.
View secure-client.js
#!/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'),
View legit-auto-pop.js
/*
* 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 / README.md
Last active Jun 13, 2021
My VS Code settings & Extensions
View README.md

Common

  • [Vim]
    • Disable CTRL+C and CTRL+V
    "vim.handleKeys": {
          "<C-c>": false,
          "<C-v>": false
      }
    
@mildronize
mildronize / README.md
Last active Nov 18, 2020
Git cheat sheet
View README.md

Deleting local branches

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

git branch -d test
@mildronize
mildronize / README.md
Created Nov 9, 2020
Typescript Design pattern
View README.md
@mildronize
mildronize / README.md
Created Nov 9, 2020
Check if an Object is a Promise in JavaScript
View README.md
View global-store.ts
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)