Skip to content

Instantly share code, notes, and snippets.

View liushooter's full-sized avatar

Shooter liushooter

View GitHub Profile
@liushooter
liushooter / solana-nft-anchor.rs
Created October 26, 2023 05:25
solana-nft-anchor.rs
use anchor_lang::prelude::*;
use anchor_spl::{
associated_token::AssociatedToken,
metadata::{
create_master_edition_v3, create_metadata_accounts_v3, CreateMasterEditionV3,
CreateMetadataAccountsV3, Metadata,
},
token::{mint_to, Mint, MintTo, Token, TokenAccount},
};
use mpl_token_metadata::{
@liushooter
liushooter / block.py
Created March 2, 2023 12:42 — forked from ChristopherJohnston/block.py
Example Blockchain hash calculations using Python
from hashlib import sha256
import time
import struct
import binascii
import datetime
VERSION = 1
def hexify(value, type):
return binascii.hexlify(struct.Struct(type).pack(value))
@liushooter
liushooter / 结巴词性标记集
Created August 10, 2022 14:00 — forked from hscspring/结巴词性标记集
结巴词性对照表
- a 形容词
- ad 副形词
- ag 形容词性语素
- an 名形词
- b 区别词
- c 连词
- d 副词
- df
- dg 副语素
- e 叹词
@liushooter
liushooter / Notes.md
Created March 5, 2022 04:17 — forked from oleksis/Notes.md
Discussion API, Graphql using gh CLI
@liushooter
liushooter / !wasmllvm.md
Created February 7, 2022 12:15 — forked from yurydelendik/!wasmllvm.md
Using WebAssembly in LLVM

NOTE: the content is out-of-date. All development is moved to the https://github.com/yurydelendik/wasmception

Using WebAssembly in LLVM

Compiling

# locations, e.g.
export WORKDIR=~/llvmwasm; mkdir -p $WORKDIR
export INSTALLDIR=$WORKDIR
@liushooter
liushooter / .rustfmt.toml
Created February 6, 2022 02:04 — forked from Robbepop/.rustfmt.toml
.rustfmt.toml with all configs, descriptions, parameters and defaults for version 0.7.1 of rustfmt.
# ----------------------------------------------------------------------------------
# r u s t f m t - C O N F I G
# ==================================================================================
#
# Version: 0.7.1
# Author : Robbepop <robbepop@web.de>
#
# A predefined .rustfmt.toml file with all configuration options and their
# associated description, possible values and default values for use in other
# projects.
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
# Forked from the original to do the opposite: Switch ssh repo urls to https
# Original here: https://gist.github.com/m14t/3056747
# Thanks to @m14t
#origin or upstream
REMOTE=${1-origin}
REPO_URL=`git remote -v | grep -m1 "^$REMOTE" | sed -Ene's#.*(git@github.com:[^[:space:]]*).*#\1#p'`
@liushooter
liushooter / semantic-ui-placeholders.md
Created August 27, 2021 10:43 — forked from tuur29/semantic-ui-placeholders.md
Semantic UI 1 & 2 Placeholders

Semantic UI 1 & 2 Placeholders

Avatars v1

Path: https://semantic-ui.com/images/avatar/[size]/[name].jpg
Sizes: large or small

  • https://semantic-ui.com/images/avatar/small/ade.jpg
  • https://semantic-ui.com/images/avatar/small/chris.jpg
  • https://semantic-ui.com/images/avatar/small/christian.jpg
@liushooter
liushooter / ffmpeg-compress-mp4
Created July 20, 2021 04:07 — forked from lukehedger/ffmpeg-compress-mp4
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@liushooter
liushooter / run_fio.sh
Created June 14, 2021 08:05 — forked from sennajox/run_fio.sh
A script that runs fio test and genearates a simple result for each jobs
#!/bin/bash
if [ $# -lt 2 ]; then
echo "usage:$0 dev output_dir [iodepth]"
echo "example 1: Testing the whole block device. Attention: That will destory the filesystem on the target block device"
echo "./run_fio.sh /dev/sdb fio_test"
echo ""
echo "example 2: Testing a file, but not destory filesystem. Suppose the target device mount on /data"
echo "fallocate -l 1G /data/test.dat"
echo "./run_fio.sh /data/test.dat fio_test"