Skip to content

Instantly share code, notes, and snippets.

View eternalphane's full-sized avatar
😶
Mechanus Mind

Zuo Zongyuan eternalphane

😶
Mechanus Mind
  • National University of Singapore
  • Singapore / Beijing
View GitHub Profile

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

ℹ️ git-conventional-commits A CLI util to ensure this conventions and generate changelogs

Commit Message Formats

Default

Aspect or Feature kubernetes/ingress-nginx nginxinc/kubernetes-ingress with NGINX nginxinc/kubernetes-ingress with NGINX Plus
Fundamental
Authors Kubernetes community NGINX Inc and community NGINX Inc and community
NGINX version Custom NGINX build that includes several third-party modules NGINX official mainline build NGINX Plus
Commercial support N/A N/A Included
Implemented in Go/Lua (while Nginx is written in C) Go/Python Go/Python
Load balancing configuration via the Ingress resource
@eternalphane
eternalphane / download.js
Created October 5, 2019 14:22
xiaozhan_toefl_tpo resource downloader (小站托福TPO资源下载)
import fs from 'fs';
import sqlite from 'sqlite';
import fetch from 'node-fetch';
(async () => {
const db = await sqlite.open('C:\\Program Files (x86)\\xiaozhan_toefl_tpo\\resources\\cache\\ylk.db');
const tags = (await db.all('SELECT DISTINCT tag FROM t_download_info WHERE tag LIKE "tpo%"')).map(row => row.tag);
for (const tag of tags) {
if (fs.existsSync(tag)) {
continue;
@eternalphane
eternalphane / SSLeay.c.patch
Created April 26, 2019 13:17
Patches for building perl module `Net::SSLeay` on Windows with MSVC 160
diff --git a/SSLeay.c b/SSLeay.c
index 5048a2f..d0cd5a7 100644
--- a/SSLeay.c
+++ b/SSLeay.c
@@ -13035,7 +13035,7 @@ XS_EUPXS(XS_Net__SSLeay_d2i_X509_CRL_bio)
;
}
- RETVAL = d2i_X509_CRL_bio(bp, unused);
+ RETVAL = d2i_X509_CRL_bio(bp, (X509_CRL**)unused);
@eternalphane
eternalphane / Get-DiskUsage.ps1
Last active April 27, 2019 04:03
du in powershell
function Get-DiskUsage {
[CmdletBinding(PositionalBinding = $false)]
param (
[Alias("a")]
[Switch]
$All,
[Alias("b")]
[Switch]
$Bytes,
[Alias("k")]
@eternalphane
eternalphane / decorator-example.ts
Last active May 6, 2018 13:49
TypeScript mixin class decorator (with initializer)
import { mixin } from './mixin.ts';
abstract class ListLike<T> {
private _data: T[] = [];
public get length(): number {
return this._data.length;
}
public add(elem: T, i?: number): void {
@eternalphane
eternalphane / stackoverflow-purifier.user.js
Last active February 19, 2024 08:52
StackOverflow净化器 屏蔽某个智障用户
// ==UserScript==
// @name StackOverflow净化器
// @namespace https://gist.github.com/EternalPhane/
// @version 0.2
// @description 屏蔽某个智障用户Ciro Santilli
// @author EternalPhane
// @include /^https?:\/\/stackoverflow\.com\//
// ==/UserScript==
(function() {
@eternalphane
eternalphane / douyu-assistant.user.js
Last active June 14, 2018 15:25
Douyu Assistant 斗鱼助手 自动领取鱼丸(需要手动输入验证码)、自动打开宝箱
// ==UserScript==
// @name 斗鱼助手
// @namespace https://gist.github.com/EternalPhane/
// @version 0.4
// @description 自动领取鱼丸(需要手动输入验证码)、自动打开宝箱
// @author EternalPhane
// @include /^https?:\/\/(www|yuxiu)\.douyu\.com\/(t\/)?\w+$/
// @resource css https://gist.github.com/EternalPhane/e5f066bd9d4535ba56ea157dc15be084/raw/douyu-assistant.css
// @resource html https://gist.github.com/EternalPhane/e5f066bd9d4535ba56ea157dc15be084/raw/douyu-assistant.html
// @grant GM_addStyle
@eternalphane
eternalphane / douyu-assistant.css
Last active February 12, 2017 06:08
Douyu Assistant resources
.douyu-assistant div {
display: -webkit-flex;
display: flex;
justify-content: space-between;
align-items: center;
margin: 4px 0px;
}
.douyu-assistant span {
line-height: 20px;
@eternalphane
eternalphane / sample.html
Created February 11, 2017 10:57
iOS style toggle switch
<!DOCTYPE html>
<html>
<body>
<label class="switch">
<input type="checkbox">
<i class="slider"></i>
</label>
</body>
</html>