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 / private-build-plans.toml
Created December 12, 2023 03:42
Custom Iosevka config
[buildPlans.iosevka-custom]
family = "Iosevka Custom"
spacing = "normal"
serifs = "sans"
no-cv-ss = true
export-glyph-names = false
[buildPlans.iosevka-custom.variants.design]
capital-d = "more-rounded-serifless"
capital-g = "toothless-corner-serifless-hooked"
@MetroWind
MetroWind / winconf.el
Created December 10, 2023 02:12
Apply a window configuration declaritively.
(defun -apply-window-configuration (conf window)
(defun -split-to-windows (conf window)
(if (null conf)
nil
(let* ((this-split (car conf))
(new-window
(cond ((eq (car this-split) 'column)
(split-window-right nil window))
((eq (car this-split) 'row)
(split-window-below nil window))
@MetroWind
MetroWind / cars.html
Created June 16, 2023 00:27
家用车分类一览
<!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
作风优良能打胜仗
Loading
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
# 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
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
机器猫……
Loading
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
#!/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
[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)
#include <iostream>
#include <vector>
#include <iomanip>
int sumSqDigits(int n)
{
int result = 0;
while(n > 0)
{
int digit = n % 10;