Skip to content

Instantly share code, notes, and snippets.

View myl7's full-sized avatar
📤
Poping

myl7

📤
Poping
View GitHub Profile
@myl7
myl7 / 魂2弹反.xml
Last active January 25, 2024 20:06
DARK SOULS II: Scholar of the First Sin(黑暗之魂2原罪学者)跳劈&弹反 Razer Synapse(雷蛇 雷云)鼠标宏。以 0.05s 为单位已手动调节到极限。结合 https://www.bilibili.com/read/cv2283238/ (archived http://web.archive.org/web/20240125200414/https://www.bilibili.com/read/cv2283238/ ) 使用。
<?xml version="1.0" encoding="utf-8"?>
<Macro xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Name>魂2弹反</Name>
<Guid>5c389610-c089-4dc2-89db-c429bc285cbf</Guid>
<MacroEvents>
<MacroEvent>
<Type>1</Type>
<KeyEvent>
<Makecode>42</Makecode>
</KeyEvent>
@myl7
myl7 / ci.yaml
Created August 23, 2023 12:24
GitHub Actions Node + pnpm basic CI
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test
runs-on: ubuntu-latest
@myl7
myl7 / ci.yaml
Created August 23, 2023 12:20
GitHub Actions Rust basic CI
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test
runs-on: ubuntu-latest
@myl7
myl7 / sendmail.py
Last active July 13, 2022 01:12
SMTP send script for simple email notification
import sys
import smtplib
SMTP_SERVER = 'smtp.mailgun.org'
SMTP_PORT = 587
SMTP_USERNAME = 'notify@noreply.myl.moe'
SMTP_PASSWORD = ''
FROM_ADDR = 'notify@noreply.myl.moe'
TO_ADDRS = ['myl7.moe@gmail.com']
@myl7
myl7 / ci.yaml
Created April 13, 2022 13:09
GitHub Actions Docker CD template
name: CI with CD
on:
push:
branches:
- main
release:
types:
- published
jobs:
ci:
@myl7
myl7 / build.sh
Created January 25, 2022 05:09
Staticly build go even with cgo but excluding external dynamic libraries
#!/usr/bin/env bash
set -euo pipefail
# Ref: https://honnef.co/posts/2015/06/statically_compiled_go_programs__always__even_with_cgo__using_musl/
CC=musl-gcc go build --ldflags '-linkmode external -extldflags "-static"' "$@" cmd/bibak/main.go
@myl7
myl7 / main.cpp
Created December 26, 2021 12:17
Append a char into std::stringstream in C++ is hard
#include <sstream>
#include <string>
#include <cstdio>
int main() {
std::stringstream a;
a << "0"; // const char *
printf("%s\n", a.str().c_str()); // 0, expected
std::stringstream b;
@myl7
myl7 / reset.css
Last active January 19, 2022 11:51
Modern CSS reset
/**
* Modern CSS reset at https://gist.github.com/myl7/7af84d97e246b733c82dd414f49dfd29
* From Josh's Custom CSS Reset at https://www.joshwcomeau.com/css/custom-css-reset/
* Public domain
*/
*, *::before, *::after {
box-sizing: border-box;
}
@myl7
myl7 / .gitconfig
Created November 20, 2021 02:54
git with proxy for github.com
[http "https://github.com"]
proxy = http://127.0.0.1:10800
[https "https://github.com"]
proxy = http://127.0.0.1:10800
@myl7
myl7 / index.html
Created November 5, 2021 08:44
Experiment to decide which way is the best one to process large (such as > 1GB) binary data in JS
<input id="input" type="file" onchange="handle()" />
<script>
let a
const handle = () => {
let e = document.getElementById('input')
let f = e.files[0]
setInterval(() => {
// console.log(f)
// No mem usage increament
// At least in Chrome, Blob is automatically put on memory or disk