Skip to content

Instantly share code, notes, and snippets.

View qiwihui's full-sized avatar
🦉
Focusing

qiwihui qiwihui

🦉
Focusing
View GitHub Profile
@0age
0age / MetamorphicContractInitCode.txt
Last active October 5, 2024 17:18
Metamorphic Contract Initialization Code
* @title Metamorphic Contract
* @author 0age, derived from cloner contract by @mhswende
* @notice This contract will create a metamorphic contract, or an upgradeable
* contract that does not rely on a transparent proxy, when deployed using
* CREATE2. It expects the deployer to provide a getImplementation() function
* that will return an implementation address, which it will then clone and
* deploy. Unlike with upgradeable transparent proxies, the state of a
* metamorphic contract will be wiped clean with each upgrade. With great power
* comes great responsibility - implement appropriate controls and educate the
* users of your contract if it will be interacted with!
@doi-t
doi-t / protocol_buffers_and_grpc_tutorial.md
Last active July 27, 2023 11:12
Protocol Buffers & gRPC Tutorial: Python & Go
@totechite
totechite / move_semantics1.rs
Last active May 17, 2023 02:33
My Rustlings answers
// move_semantics1.rs
// Make me compile! Scroll down for hints :)
pub fn main() {
let vec0 = Vec::new();
let mut vec1 = fill_vec(vec0);
println!("{} has length {} content `{:?}`", "vec1", vec1.len(), vec1);
@xeraa
xeraa / .env
Last active March 14, 2020 08:55
Minimal 3 node Elasticsearch + Kibana setup
ELASTIC_VERSION=5.6.9
#ELASTIC_VERSION=6.3.0
@liudanking
liudanking / kera_retrain_model.py
Created June 9, 2018 11:05
Retrain model with keras based on resnet
from keras import applications
from keras.preprocessing.image import ImageDataGenerator
from keras import optimizers
from keras.models import Sequential, Model
from keras.layers import Dropout, Flatten, Dense, GlobalAveragePooling2D
from keras import backend as k
from keras.callbacks import ModelCheckpoint, LearningRateScheduler, TensorBoard, EarlyStopping
img_width, img_height = 256, 256
train_data_dir = "tf_files/codoon_photos"
@bargst
bargst / ledger.py
Created June 3, 2018 21:08
Python Ledger Account list and sign
# Requirement: pip install ledgerblue
from ledgerblue.comm import getDongle
import struct
ETH_DERIVATION_PATH_PREFIX = "44'/60'/0'/"
class LedgerAccount:
"""
Ledger Ethereum App Protocol Spec is located at:
<https://github.com/LedgerHQ/blue-app-eth/blob/master/doc/ethapp.asc>
@BFDZ
BFDZ / zimuzu-sign.sh
Last active December 28, 2020 03:32
字幕组网站签到
#!/bin/bash
ACCOUNT="user"
PASSWORD="123456"
#########################################
function urlEncode() {
python -c "
import urllib, commands, os;
@dideler
dideler / bot.rb
Last active May 7, 2025 12:44
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@mknippen
mknippen / GobanFloodFill.playground
Created March 21, 2018 05:54
Go Flood Fill Playground
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
enum Stone {
case Black, White, None
func opposite() -> Stone {
switch self {