Skip to content

Instantly share code, notes, and snippets.

@youngkiu
youngkiu / crypto-aes-256-gcm-demo.js
Last active November 12, 2022 14:07 — forked from rjz/crypto-aes-256-gcm-demo.js
example using node.js crypto API with aes-256-gcm
const crypto = require('crypto');
// Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib.
const aes256gcm = (key) => {
const ALGO = 'aes-256-gcm';
// encrypt returns base64-encoded ciphertext
const encrypt = (str) => {
// The `iv` for a given key must be globally unique to prevent
// against forgery attacks. `randomBytes` is convenient for
@youngkiu
youngkiu / 9c_AllTx.py
Last active June 17, 2021 04:27
Retrieve all transactions of a specific address.
import requests
import json
def get_all_transactions(address):
query = '''
query($address: Address!) {
chainQuery {
transactionQuery{
signerTransactions: transactions(signer: $address) {
import requests
import json
from functools import reduce
def get_gold_balance(agent_address, type_id):
query = '''
query($agent: Address!) {
goldBalance(address: $agent)
chainQuery {
@youngkiu
youngkiu / 9c_Address_Tx.py
Last active June 11, 2021 07:01
View Transactions.Actions of Nine Chronicles Agent
import requests
from functools import reduce
def get_agent_transactions(agent_address):
query = '''
query($agent: Address) {
chainQuery {
transactionQuery{
signerTransactions: transactions(signer: $agent) {
@youngkiu
youngkiu / 9c_Block_Tx.py
Created June 11, 2021 05:26
View Transactions.Actions within the Nine Chronicles block
import requests
def get_block_actions(block_hash):
query = '''
query($blockHash: ID) {
chainQuery {
blockQuery {
block(hash: $blockHash) {
transactions {
@youngkiu
youngkiu / Free_Beyond_Compare.md
Last active December 15, 2019 02:13 — forked from njleonzhang/Free_Beyond_Compare.md
Free Beyond Compare by unlimited trail

1 . goto beyond compare folder

 cd "/Applications/Beyond Compare.app/Contents/MacOS/"

2 . rename BCompare to BCompare.real

 mv BCompare BCompare.real