Skip to content

Instantly share code, notes, and snippets.

View 9oelM's full-sized avatar
🎯
Focusing

Joel Mun 9oelM

🎯
Focusing
View GitHub Profile
{
"openapi": "3.1.0",
"info": { "title": "FastAPI", "version": "0.1.0" },
"paths": {
"/generate_wallet": {
"post": {
"summary": "Generate Wallet",
"description": "Parameters required:\n - password (str): The user's password.\n - referral_code (Optional[str]): The user's referral code. Omit if not used.\n\n1) Generate a brand-new mnemonic (SECP256K1).\n2) Create the XRPL Wallet from that mnemonic.\n3) Encrypt the mnemonic and store partial info in Supabase.\n4) Return: mnemonic (plaintext), encrypted_credentials, and classic_address.",
"operationId": "generate_wallet_generate_wallet_post",
"requestBody": {
@9oelM
9oelM / report-outdated-npm-deps.sh
Created November 21, 2024 03:53
Report outdated npm deps except those specified
#!/bin/bash
set -euv
# Get outdated dependencies
result=$(npm outdated | tail -n +2 | awk '{print $1}')
# Exit early if there are no outdated dependencies
if [ -z "$result" ]; then
echo "No outdated dependencies found."

Starter

Starter is the simplest possible hook: it just accepts all transactions and logs that it is running.

to test:

  • in the develop pane, compile starter.c
  • in the deploy pane, deploy it to Alice account
  • set up payment transaction from Alice to Bob
  • run it and see in the debug stream 'Accept.c: Called.'
@9oelM
9oelM / Why.go
Created January 14, 2023 08:51
WHY
package main
import (
"log"
"time"
)
type Big struct {
test string
test1 string
@9oelM
9oelM / test.js
Last active August 29, 2022 03:22
notion-client debugging
import { NotionGraph } from "@graphcentral/notion-graph-scraper";
(async () => {
const notionGraph = new NotionGraph({
maxDiscoverableNodes: 2000,
maxDiscoverableNodesInOtherSpaces: 2000,
maxConcurrentRequest: 100,
verbose: true,
});
const graph = await notionGraph.buildGraphFromRootNode(
@9oelM
9oelM / verses.sh
Last active January 7, 2022 11:05
Get bible verses from bash shell
#!/bin/bash
set -e # exit on first error
TRANSLATION="kjv"
all_books="
'GEN' => 'Genesis',
'EXO' => 'Exodus',
'LEV' => 'Leviticus',
'NUM' => 'Numbers',
@9oelM
9oelM / search-binaryedge.sh
Created December 5, 2021 18:12
search-binaryedge.sh
#!/bin/bash
PAGE_SIZE="1"
ONLY_IPS="1"
usage="
A part of
___ ___ ___
/\ \ /\ \ /\__\
/::\ \ \:\ \ /::| |
/:/\:\ \ \:\ \ /:|:| |
@9oelM
9oelM / tcSync.ts
Last active March 9, 2021 13:50
Try catch sync wrapper
export function tcSync<Fn extends (...args: any) => any, Deps extends Parameters<Fn> = Parameters<Fn>>(fn: Fn, deps: Deps): TcResult<ReturnType<Fn>> {
try {
const data: ReturnType<Fn> = fn(...deps);
return [null, data];
} catch (e) {
return [e] as [Error]
}
}
@9oelM
9oelM / deploy_with_ebcli3_on_circleci.md
Created January 20, 2021 15:24 — forked from RobertoSchneiders/deploy_with_ebcli3_on_circleci.md
Settings to deploy to AWS Elastic Beanstalk on CircleCi (EB Cli 3)

This is how I configured the deploy of my rails apps to AWS Elastic Beanstalk through CircleCI 1.0.

If you are using the Circle CI 2.0, take a look at this article from ryansimms

Configure Environments Variables

On Project Settings > Environment Variables add this keys:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
    The aws user must have the right permissions. This can be hard, maybe, this can help you.