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
  • Thailand
View GitHub Profile
@SuperCipher
SuperCipher / shell.nix
Last active July 6, 2021 12:24
nix-shell import remote shell config
nix-shell -I variableFoo=https://github.com/edolstra/flake-compat/archive/master.tar.gz -E "import <variableFoo>"
nix-shell -E 'import (builtins.fetchurl "https://raw.githubusercontent.com/workflow/nix-shell-action/main/shell.nix") {}'
@SuperCipher
SuperCipher / flushDnsCache.sh
Created July 21, 2021 07:01
Flush DNS Cache mac
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
@SuperCipher
SuperCipher / gist:572214debd8bea53b54f7b6cd0857d75
Created July 31, 2021 09:11
Best way to deal with piece of shit google HTTP Referer API restriction
https://stackoverflow.com/a/50146434/3422861
@SuperCipher
SuperCipher / postgres-cheatsheet.md
Created September 9, 2021 13:44 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@SuperCipher
SuperCipher / bu_make_j2_error_log.txt
Created September 11, 2021 09:44
bu "make -j2" build error
docker build . ⮂
[+] Building 509.3s (14/15)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 932B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:18.04
@SuperCipher
SuperCipher / deployment.yml
Created September 15, 2021 14:47 — forked from troyharvey/deployment.yml
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
@SuperCipher
SuperCipher / instagram-compact-style.css
Created September 19, 2021 11:29
instagram css style rewrite (compact short scroll)
/*use with custome style script extension*/
._8Rm4L, .AcVnq {
margin-bottom: 0px;
}
.Ppjfr{
height: 40px
}
.MEAGs{
height: 40px
@SuperCipher
SuperCipher / Solana JSON RPC
Created November 16, 2021 16:06
Solana JSON RPC
curl https://mango.devnet.rpcpool.com -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getAccountInfo",
"params": [
"8mFQbdXsFXt3R3cu3oSNS3bDZRwJRP18vyzd9J278J9z",
{
"encoding": "base64"
}
@SuperCipher
SuperCipher / mangoDecodeRate.ts
Created November 18, 2021 14:56
mango rate decode
import {
blob,
Blob,
greedy,
Layout,
nu64,
seq,
struct,
Structure,
u16,
@SuperCipher
SuperCipher / curl-eth-json-rpc.md
Last active January 25, 2022 05:59
Eth JSON RPC status

Get current block:

curl '172.21.0.3:8545' -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}'

result

 { "id":83, "jsonrpc": "2.0", "result": "0x4b7"  }

or