Skip to content

Instantly share code, notes, and snippets.

View 9oelM's full-sized avatar
🎯
Focusing

Joel Mun 9oelM

🎯
Focusing
View GitHub Profile
@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.
@9oelM
9oelM / circleci-2.0-eb-deployment.md
Created January 20, 2021 15:20 — forked from ryansimms/circleci-2.0-eb-deployment.md
Deploying to Elastic Beanstalk via CircleCi 2.0

Deploying to Elastic Beanstalk via CircleCi 2.0

I got to here after spending hours trying to deploy to an Elastic Beanstalk instance via CircleCi 2.0 so I thought I'd write up what worked for me to hopefully help others. Shout out to RobertoSchneiders who's steps for getting it to work with CircleCi 1.0 were my starting point.

For the record, I'm not the most server-savvy of developers so there may be a better way of doing this.

Setup a user on AWS IAM to use for deployments

@9oelM
9oelM / gist:440720a4efd6641faedea90e14565ca2
Created January 13, 2021 15:55 — forked from alisterlf/gist:3490957
JAVASCRIPT:Remove Accents
function RemoveAccents(strAccents) {
var strAccents = strAccents.split('');
var strAccentsOut = new Array();
var strAccentsLen = strAccents.length;
var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var accentsOut = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
for (var y = 0; y < strAccentsLen; y++) {
if (accents.indexOf(strAccents[y]) != -1) {
strAccentsOut[y] = accentsOut.substr(accents.indexOf(strAccents[y]), 1);
} else