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
#!/usr/bin/env python3
# created at 2024.10.05
import argparse
from decimal import Decimal as D
from data_process.io_csv import read_csv, write_csv # python3 -m pip install data-process
def cal_distance(lat1, lon1, lat2, lon2):
"""
Calculate the great circle distance between two points
// ==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 = "-"
#!/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
pragma solidity ^0.4.24;
contract BasicToken {
uint256 totalSupply_;
mapping(address => uint256) balances;
constructor(uint256 _initialSupply) public {
totalSupply_ = _initialSupply;
balances[msg.sender] = _initialSupply;
package main
import (
"io/ioutil"
"log"
"net/http"
)
func index(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
#!/bin/bash
# macos: brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb
user=$1
ip_or_tail=$2
if echo $ip_or_tail | grep -E '\.' >/dev/null; then
user_host=$user@$ip_or_tail
else
[email protected].$ip_or_tail