Skip to content

Instantly share code, notes, and snippets.

View luatnd's full-sized avatar
:octocat:
🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋

Luat Nguyen luatnd

:octocat:
🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋 🦋
View GitHub Profile
@luatnd
luatnd / merge-kubeconfig
Created October 19, 2023 10:21
merge kube config files tool to work with multiple k8s env
#!/bin/bash
# Usage: merge-kubeconfig [-h] [-r] [file1] [file2] [...] [file n]
# Options:
# -h, --help Show help
# -r, --reset override(replace) the current config rather than merge with it
#
# Eg:
#
# 1) Append
@luatnd
luatnd / library.js
Created October 14, 2023 06:15
The re-formatted code of node_modules/@prisma/client/runtime/library.js
"use strict";
var Ll = Object.create;
var Mt = Object.defineProperty;
var $l = Object.getOwnPropertyDescriptor;
var ql = Object.getOwnPropertyNames;
var Vl = Object.getPrototypeOf, jl = Object.prototype.hasOwnProperty;
var Bl = (e, t, r) => t in e ? Mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
var V = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), St = (e, t) => {
for (var r in t) Mt(e, r, { get: t[r], enumerable: !0 })
}, Xi = (e, t, r, n) => {
@luatnd
luatnd / sol-token-LUAT.json
Created April 17, 2023 10:55
Example solana token
{
"name": "Luat Dev",
"symbol": "LUAT",
"description": "Just a non-prod ready token",
"image": "https://avatars.githubusercontent.com/u/1859127?v=4",
"external_url": "https://luatnd.github.io/aframe-react-demo/",
"attributes": [
{
"trait_type": "Speed",
"value": "Rapid"
@luatnd
luatnd / caesar-cypher-with-password.md
Last active April 7, 2024 10:37
Caesar cypher with password - simple method for storing password, private key, mnemonic

mxn0 encrypt with password

Note: This was deprecated, please use this instead: https://luatnd.github.io/caesar-password/

The simple encrypt by combining simple encoding + password method:

  • phrase was split into words by space seperator: "hello world this is an example" => ['hello', 'world', 'this', 'is', 'an', 'example']

  • words will be encoded by a customized caesar cypher encoding:

    supported_chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';

    password = "your free password"

@luatnd
luatnd / Number.ts
Last active June 28, 2022 08:00
[typescript/utils] A functions with currency and number formatting - useful for financial app
import numeral from 'numeral'
import {isClientDevMode} from "./Env";
type NumberFormatOption = {
// whether to show +/- sign before formatter number
sign?: boolean
separator?: string
// trim non-meaningful zero character
zero_trim?: boolean
// no round: Eg: in case of decimal = 2 ==> 0.129 will not be rounded to 0.13
@luatnd
luatnd / index.html
Last active May 21, 2019 09:59 — forked from TimothyGu/index.html
JS Object: Iteration performance (https://jsbench.github.io/#7e111014592d2a6fd7a0e9284100891a) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>JS Object: Iteration performance</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@luatnd
luatnd / README-Template.md
Created July 19, 2017 05:41 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites