Skip to content

Instantly share code, notes, and snippets.

View MetroWind's full-sized avatar
🐱
Setting status…

Metro Wind MetroWind

🐱
Setting status…
View GitHub Profile
@MetroWind
MetroWind / cars.html
Created June 16, 2023 00:27
家用车分类一览
View cars.html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<title>My test page</title>
<script>
function draw()
{
const canvas = document.getElementById("tutorial");
@MetroWind
MetroWind / house.svg
Created May 18, 2023 04:05
作风优良能打胜仗
View house.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MetroWind
MetroWind / Config.ini
Created June 28, 2022 03:53
Elden Ring PS 5 rune farm
View Config.ini
# DS4Emulator by r57zone
# ReadMe: https://github.com/r57zone/DualShock4-emulator
# Key codes: https://github.com/r57zone/Half-Life-Alyx-novr/blob/master/BINDINGS.md
# Support the project: https://r57zone.github.io/support.html
[Main]
ExitBtn=112
InvertX=0
InvertY=0
@MetroWind
MetroWind / tests.txt
Created June 10, 2022 22:03
Email validation test
View tests.txt
first.last@iana.org
Valid
1234567890123456789012345678901234567890123456789012345678901234@iana.org
Valid
first.last@sub.do,com
Invalid
"first\"last"@iana.org
Valid
first\@last@iana.org
Invalid
@MetroWind
MetroWind / doraemon.svg
Last active May 18, 2022 04:49
机器猫……
View doraemon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MetroWind
MetroWind / make-shot.sh
Created May 5, 2022 17:54
Combine two screenshots
View make-shot.sh
#!/usr/bin/env zsh
convert -size 1292x928 xc:black -fill white -draw "path 'M 200,0 C 200,800 1500,720 1500,1100 V 2000 H 2000 V -20 H 200 L 200,0'" mask.png
composite dark.png light.png mask.png test.png
convert test.png \( light.png -channel a -separate +channel \) -alpha off -compose CopyOpacity -composite shot.png
rm test.png mask.png
@MetroWind
MetroWind / Cargo.toml
Created February 26, 2022 04:09
Image cutter
View Cargo.toml
[package]
name = "jqm-cutter"
version = "0.1.0"
authors = ["MetroWind <chris.corsair@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
image = ">=0.24"
@MetroWind
MetroWind / happy.cpp
Created February 23, 2022 03:46
Check if a number is a “happy number”, constant-space algorithm, with visualization of the algorithm. (https://en.wikipedia.org/wiki/Happy_number)
View happy.cpp
#include <iostream>
#include <vector>
#include <iomanip>
int sumSqDigits(int n)
{
int result = 0;
while(n > 0)
{
int digit = n % 10;
@MetroWind
MetroWind / naive-edge-offset.py
Last active December 13, 2021 07:49
Offset a loop of edges. Probably only works in the simple case where the loop is convex and the internal ordering of the vertices is "nice".
View naive-edge-offset.py
# Offset a loop of edges. Probably only works in the simple case where the loop
# is convex and the internal ordering of the vertices is "nice".
#
# Usage:
#
# 1. In edit mode, select a loop of vertices. The vertices should be roughly on
# the same plane.
# 2. Scroll to the bottom of this file, and change the offset distance in the
# offset function call. The distance can be negative.
# 3. Press "Run Script".
View E8V2WbFApNCI
U2FsdGVkX19lCY21RfgdarDUXJV0P/qEiS6vue8m4cI6Jz026MbNECmACkzxafMZxyp9CKCATo7ZcIrb0kYomndSKqkHNVIXrNLqoRiiQ7/bFJIYkpx4cBurodWPx0jJbfWkk/uJs3vFNU7Ig6cdJjX0767FAhLaRiOUf/skzskR3jMmaTW1Ja9GDRSQIEoD8VO1xqaInVdOoAfvuAm2qVczGLPFvAdWTUrIyqNJuM5VPgfz8YRsY2/RAqdCidaEws1elz17ClLjNs6PIVURReysp7aABIY49hMO5G6CyU5P3B4IjJUrjCuUgr6fb0w2wW0LKI5s3hbnHbTgMCqqN6DHX4pJ1JWinm9JEDzcuPNxe7K3iZr/YqDpQhyFGbFkLHJgvyOAkkwjSn7QZrVY9md5gX0FcynAqIMm29fwAdJtPJFTchnvvqFdTl+PKLojzVYwYrDYd5toSIsJUrrd6S/3J/CBPTXxAbMkISINKrI0zGhp4zVEHSp1rR5ziYYtHHivcQIOp1GmpTt08e+g7cBwwPmIonlmHq6LpGkjERPdaZUAuptTWUiWOZub8R9+XiV4ILdCgzua1csvBpgcn/dtgv/S3OMsWp9jqdX3iKpDmpQsO9MhTGgIlTd8NsTlMgnOGb1Hxa78xkge1iqCC0M3lA8QBUmP/eCYHxoQd+BvRfE/ww5NQmr86m8A8+aQUjy0MA8/rRTm1kOs/wP8E5/xP8e7fzNdsrPjuz27lcte9mg/4em+wliNdVZDfCGuMx5I7EysyN/sfr5sU5lFbmgAMB18r+nc48HcVYkJRjfGYF6dUqpoE1e6W7nXaul53eMLrO2yYuOd+GJ/inWn6+7j4ku90s8Lw/CDZ4t/zdlB74OqO7Cz6dTlA4PmOs5SBrExLBtDK9IZpKboQWSLbtRlyrCiZHHxl1tTPvUCZm0HgODox87BxRpT/qYWrvjlF4wn/5RRW+npHnzZf+cuXi3bVofLrqeBPxJgzUsA4szkytsW7rIcr9PRSAlVSGs3