Skip to content

Instantly share code, notes, and snippets.

View henter's full-sized avatar
🏠
Working from home

Henter henter

🏠
Working from home
  • B
  • West Korean
View GitHub Profile
@zhangyouxin
zhangyouxin / .js
Last active December 26, 2023 10:54
dota-rc20_inscription
const { ApiPromise, WsProvider } = require("@polkadot/api");
const { Keyring } = require("@polkadot/keyring");
async function main() {
//wss://rpc-polkadot.luckyfriday.io
// wss://polkadot.public.curie.radiumblock.co/ws
// wss://1rpc.io/dot
// wss://rpc.polkadot.io
const provider = new WsProvider("wss://1rpc.io/dot");
const api = await ApiPromise.create({ provider });
@dylanzan
dylanzan / Github中国大陆访问代理.txt
Last active January 18, 2024 13:45
github 中国大陆访问代理
GitHUB 访问代理:
软件功能简介:
· 域名纯净IP解析:提供无污染的域名解析服务,增强访问质量。
· IP测速与选择:自动测速并选择连接最快的IP地址。
· CDN资源替换:用于google CDN资源,解决部分国外网站的js和css加载问题。
· 非翻墙安全性:保持网络连接安全且干净,不记录用户信息。
Linux临时网络配置:
设置临时的HTTP和HTTPS代理(解决github releases,wget,curl等操作中可能出现的网络问题):
export https_proxy=http://git.iizone.com.cn:32222
export http_proxy=http://git.iizone.com.cn:32222
@ninehills
ninehills / chatpdf-zh.ipynb
Last active April 9, 2024 06:40
ChatPDF-zh.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@liviaerxin
liviaerxin / README.md
Last active April 15, 2024 01:53
FastAPI and Uvicorn Logging #python #fastapi #uvicorn #logging

FastAPI and Uvicorn Logging

When running FastAPI app, all the logs in console are from Uvicorn and they do not have timestamp and other useful information. As Uvicorn applies python logging module, we can override Uvicorn logging formatter by applying a new logging configuration.

Meanwhile, it's able to unify the your endpoints logging with the Uvicorn logging by configuring all of them in the config file log_conf.yaml.

Before overriding:

uvicorn main:app --reload
@sbarratt
sbarratt / scrape_ftx.py
Last active July 10, 2023 03:35
A script to export all FTX history
import pandas as pd
import time
import requests
import time
import hmac
from requests import Request
import sys
import json
import os
@Victrid
Victrid / gitgraft.sh
Created August 29, 2022 17:09
Find which commit your no-git friend is working on and generate patches for attaching their works onto git tree.
#!/bin/bash
hash git 2>/dev/null || { echo >&2 "Required command 'git' is not installed. ( hmm... why are you using this? ) Aborting."; exit 1; }
hash realpath 2>/dev/null || { echo >&2 "Required command 'realpath' is not installed. Aborting."; exit 1; }
hash pwd 2>/dev/null || { echo >&2 "Required command 'pwd' is not installed. Aborting."; exit 1; }
hash cd 2>/dev/null || { echo >&2 "Required command 'cd' is not installed. Aborting."; exit 1; }
hash echo 2>/dev/null || { echo >&2 "Required command 'echo' is not installed. Aborting."; exit 1; }
hash mv 2>/dev/null || { echo >&2 "Required command 'mv' is not installed. Aborting."; exit 1; }
hash diff 2>/dev/null || { echo >&2 "Required command 'diff' is not installed. Aborting."; exit 1; }
hash diffstat 2>/dev/null || { echo >&2 "Required command 'diffstat' is not installed. Aborting."; exit 1; }
@ethanhuang13
ethanhuang13 / VirtualKeyboard.swift
Last active February 7, 2024 05:58
MacBook Air M1 Zhuyin Keyboard written with SwiftUI ~=300 LOC, < 4hrs
//
// VirtualKeyboard.swift
// MacBook Air M1 Zhuyin Keyboard
// Written with SwiftUI ~=300 LOC, < 4hrs
// Created by Ethan Huang on 2021/1/13.
// Twitter: @ethanhuang13
import SwiftUI
struct VirtualKeyboard: View {
@v1vendi
v1vendi / api_generator.js
Created August 20, 2019 19:19
REST API functional generator
const fetch = (...args) => console.log(...args) // mock
function httpRequest(url, method, data) {
const init = { method }
switch (method) {
case 'GET':
if (data) url = `${url}?${new URLSearchParams(data)}`
break
case 'POST':
case 'PUT':
case 'PATCH':
package main
import (
"fmt"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
)
{
"福建省": {
"南平市": {
"松溪县": {
"code": "350724",
"level": 3,
"parentCode": "350000",
"name": "松溪县",
"lon": 118.765689,
"lat": 27.610704