Skip to content

Instantly share code, notes, and snippets.

View SuperCipher's full-sized avatar
💭
GMT+7 08:00 - 22:00

Napat SuperCipher

💭
GMT+7 08:00 - 22:00
  • BiggestFan Production
  • Thailand
View GitHub Profile
@christroutner
christroutner / slpdb-review.md
Last active November 20, 2021 07:11
SLPDB Review

SLP Indexing Review

Overview

This report was sponsored by an anonymous donor. I'd like to thank them for the generous contribution to the industry, the PSF, and to me.

The purpose of the report is to:

  • Assess the current state of SLPDB and SLP indexing in the industry.
  • Explore the costs of improving the indexer or creating a new one.

The SLPDB indexer gave rise to a prolific token economy on the Bitcoin Cash blockchain. eCash, a fork of Bitcoin Cash, also makes use of SLP tokens as well. Both ecosystems require a robust indexer in order to sustain their token economies.

# private key
openssl ecparam -genkey -name secp521r1 -noout -out es512-private.pem
# public key
openssl ec -in ecdsa-p521-private.pem -pubout -out es512-public.pem
@JaysonChiang
JaysonChiang / api.ts
Last active May 22, 2024 09:07
Example of Axios with TypeScript
import axios, { AxiosError, AxiosResponse } from 'axios';
import token from './somewhere';
interface Todo {
id: string;
title: string;
}
interface User {
id: string;
@chrisanthropic
chrisanthropic / nixos-raspi4.md
Last active March 12, 2024 13:39
NixOS + Raspi4

Download the image builder

  • git clone git@github.com:Robertof/nixos-docker-sd-image-builder.git
  • cd nixos-docker-sd-image-builder

Configure for Raspi4

  • modify /config/rpi4/default.nix to increase size of boot partition
    • this step is optional but I ran out of space in /boot pretty quickly with the default setting since I'm still learning and rebuilding a lot. Let's leave some room for trial & error.
    • sdImage.firmwareSize = 1024;
  • modify /config/sd-image.nix
  • ./rpi3 becomes ./rpi4
#!/usr/bin/env stack
-- stack --resolver lts-12.18 script
import Control.Concurrent (threadDelay)
import Control.Concurrent.Async (replicateConcurrently_)
import Control.Monad (unless)
import Data.IORef
import System.Random (randomIO)
main :: IO ()
main = do
@OliverJAsh
OliverJAsh / foo.ts
Last active July 29, 2023 18:16
Records and dictionaries in TypeScript
/*
In JavaScript, objects can be used to serve various purposes.
To maximise our usage of the type system, we should assign different types to our objects depending
on the desired purpose.
In this blog post I will clarify two common purposes for objects known as records and dictionaries
(aka maps), and how they can both be used with regards to the type system.
@troyharvey
troyharvey / deployment.yml
Last active May 9, 2024 10:55
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@ejlp12
ejlp12 / gist:059373f1785c52114d778a4ee7277ccb
Created October 25, 2017 01:45
upgrade vagrant on mac os-x
brew cask reinstall vagrant
# this might take a long time
vagrant plugin update
@diegopacheco
diegopacheco / Istio-minikube-rancher.md
Created September 5, 2017 17:29
Minikube + Istio + Rancher
minikube start
helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator
helm install -n istio incubator/istio
kubectl apply -f <(istioctl kube-inject -f samples/apps/bookinfo/bookinfo.yaml)
git clone https://github.com/diegopacheco/rancher-istio.git
cd rancher-istio/
kubectl get services istio-ingress -o wide

export POD_NAME=$(kubectl get pods --namespace default -l "component=istio-istio-grafana" -o jsonpath="{.items[0].metadata.name}")
@andreasonny83
andreasonny83 / README.md
Last active May 13, 2024 06:32
Readme template

npm version code style: prettier

Project Name

Write a project description

Prerequisites

This project requires NodeJS (version 8 or later) and NPM.