Skip to content

Instantly share code, notes, and snippets.

View weaming's full-sized avatar
🦀
Rustacean

Garden Yuen weaming

🦀
Rustacean
  • Shenzhen, China
View GitHub Profile
@weaming
weaming / caiyun-translate-for-tampermonkey.js
Created September 24, 2020 05:42
彩云小译油猴脚本,添加按钮开启翻译!
// ==UserScript==
// @name 彩云小译
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 彩云小译自制脚本
// @author github@weaming
// @include *
// @grant none
// ==/UserScript==
#!/usr/bin/env python3
# For M1:
#!/usr/bin/arch -x86_64 /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
"""
Batch convert DNG to TIFF.
Install dependencies:
python3 -m pip install numpy cython imageio
@weaming
weaming / boostnote2md.py
Last active August 7, 2023 09:51
Convert boostnote cson format data to markdown
#!/usr/bin/env python3
# coding: utf-8
"""
Author : weaming
Created Time : 2018-05-26 21:32:59
Prerequisite:
python3 -m pip install cson arrow
"""
import json
import os
// ==UserScript==
// @name Shotcuts
// @namespace http://bitflow.org
// @version 0.1
// @description add shotcuts
// @match https://*/*
// @copyright 2022+, You
// ==/UserScript==
function onKey(e) {
// console.log(e, e.key);
---
# ---------------------------------------------------
# 语法 https://github.com/Dreamacro/clash/wiki/configuration
# 配置文件需要放置在 $HOME/.config/clash/config.yml
# 如果您不知道如何操作,请参阅 https://github.com/Hackl0us/SS-Rule-Snippet/wiki/clash(X)
# 由于 ClashCore 1.0 的发布,ClashX 1.30.x 的版本包括不向前兼容的更新。如果您的配置文件尚未兼容新的配置文件格式,请谨慎更新。
# 查看详细内容:https://github.com/Dreamacro/clash/wiki/breaking-changes-in-1.0.0
# ---------------------------------------------------
package main
import (
"fmt"
)
func one(n int64) {
ids := []int64{}
for i := int64(1); i <= n; i++ {
ids = append(ids, i)
#!/usr/local/bin/python
import json
import datetime
from urllib.request import urlopen
INSTANCES = [
{
# Your private key for accessing gitlab: User -> Settings -> Access tokens -> add personal access token with api scope
package main
import (
"encoding/json"
"fmt"
"strings"
)
const DASH = "-"
@weaming
weaming / clean-android-sdcard.sh
Last active August 14, 2022 07:33
Shell script to clean my android SDCard
# Preconditions:
# 1. Install adb drivers on your computer
# 2. Append the path of 'adb.exe' to the PATH environment variable
# 3. run "adb devices" to run adb ademon in background and list all connected devices
# 4. run "adb shell" get in the shell interface
cd /sdcard
# list all directories in current path, whose size is less than 100 KB
#du -d 1 | grep -v '\./\.' | awk '$1 < 100 {print $0}'
pragma solidity ^0.4.24;
contract BasicToken {
uint256 totalSupply_;
mapping(address => uint256) balances;
constructor(uint256 _initialSupply) public {
totalSupply_ = _initialSupply;
balances[msg.sender] = _initialSupply;