Skip to content

Instantly share code, notes, and snippets.

View nonjosh's full-sized avatar
🇭🇰
ლ(゚д゚ლ)

Johnson Wong nonjosh

🇭🇰
ლ(゚д゚ლ)
View GitHub Profile
@nonjosh
nonjosh / Dockerfile
Last active June 13, 2024 16:38
Deploy PostgreSQL docker image with pg_aduit installed, so as PgAdmin configured
FROM postgres:16.3-bookworm
RUN apt-get update && apt-get install -y --no-install-recommends \
postgresql-$PG_MAJOR-pgaudit
COPY init.sql /docker-entrypoint-initdb.d/
CMD ["postgres", "-c", "shared_preload_libraries=pgaudit"]
@nonjosh
nonjosh / sum.md
Created November 13, 2023 15:31
use geometric sum to deive sum of natural numbers for different orders

Derivation of the sum of the first n natural numbers of different powers

use the geometric series + L'Hospital's rule

$$ \begin{align} \sum_{i=0}^{n} x^{i} &= \frac{x^{n+1}-1}{x-1} \ \frac{d}{dx}(\sum_{i=0}^{n} x^{i}) &= \frac{d}{dx}(\frac{x^{n+1}-1}{x-1}) \ \sum_{i=1}^{n} ix^{i-1} &= \frac{nx^{n+1}-(n+1)x^n+1}{(x-1)^2} \end{align}

@nonjosh
nonjosh / acgn_list.yml
Last active July 22, 2025 14:58
list of url for acgn-bot to import
- name: 舔狗生肉
novel_urls:
- https://ncode.syosetu.com/n6621fl/?p=2
- https://kakuyomu.jp/works/1177354054888541019
- https://masiro.me/admin/novelView?novel_id=212
- name: 不知我的死亡flag將於何處停止
novel_urls:
- https://ncode.syosetu.com/n4449cj/?p=2
- https://tieba.baidu.com/f?kw=%E4%B8%8D%E7%9F%A5%E6%88%91%E7%9A%84%E6%AD%BB%E4%BA%A1flag%E5%B0%86%E4%BA%8E%E4%BD%95%E5%A4%84%E5%81%9C%E6%AD%A2&ie=utf-8&tp=0
# - name: 悲劇元兇的最強外道BOSS女王為民竭力
@nonjosh
nonjosh / .p10k.zsh
Last active August 16, 2022 19:04
my powerlevel10k config
# Generated by Powerlevel10k configuration wizard on 2022-08-07 at 03:56 CST.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 62739.
# Wizard options: nerdfont-complete + powerline, small icons, classic, unicode, dark,
# 24h time, angled separators, sharp heads, flat tails, 2 lines, disconnected,
# left frame, sparse, many icons, fluent, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
# your own config based on it.
#
@nonjosh
nonjosh / markdown_examples.md
Created June 13, 2022 14:35
markdown syntax examples

README

该文件用来测试和展示书写README的各种markdown语法。GitHub的markdown语法在标准的markdown语法基础上做了扩充,称之为GitHub Flavored Markdown。简称GFM,GFM在GitHub上有广泛应用,除了README文件外,issues和wiki均支持markdown语法。


Author 果冻虾仁
E-mail Jelly.K.Wang@qq.com
@nonjosh
nonjosh / turn_off_screen.ps1
Created March 21, 2022 03:20
Turn display off by calling WindowsAPI with PowerShell script
# Turn display off by calling WindowsAPI.
# SendMessage(HWND_BROADCAST,WM_SYSCOMMAND, SC_MONITORPOWER, POWER_OFF)
# HWND_BROADCAST 0xffff
# WM_SYSCOMMAND 0x0112
# SC_MONITORPOWER 0xf170
# POWER_OFF 0x0002
Add-Type -TypeDefinition '
using System;
@nonjosh
nonjosh / ddo.new.txt
Created October 18, 2021 02:52
Compare difference of packs between two DDO free coupon
Against the Slave Lords
Attack on Stormreach
Delera’s Tomb
Devil Assault
Disciples of Rage
Dragonblood Prophecy
Eveningstar Challenge Pack
Harbinger of Madness
Haunted Halls of Eveningstar
Heart of Madness
@nonjosh
nonjosh / tampermonkey.js
Created August 6, 2021 02:55
TamperMonkey script for adding white background to transparent image in GitHub, which cannot display well in Dark Mode
// ==UserScript==
// @name Add white background for transparent img in GitHub
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Add white background for transparent img in GitHub
// @author nonjosh@gmail.com
// @match https://github.com/*
// @icon https://github.com/favicon.ico
// @grant GM_addStyle
// @run-at document-start
@nonjosh
nonjosh / tampermonkey.js
Last active August 6, 2021 03:04
Tampermonkey script for changing tieba home page background
// ==UserScript==
// @name tieba change background
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://tieba.baidu.com/home/main*
// @grant GM_addStyle
// @run-at document-start
// ==/UserScript==
@nonjosh
nonjosh / tampermonkey.js
Last active August 6, 2021 03:03
TamperMonkey script for showing full filenames in HTTP directory
// ==UserScript==
// @name HTTP directory listing full filenames
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @require https://code.jquery.com/jquery-3.4.1.slim.min.js
// @match <your http directory url>
// @grant none
// ==/UserScript==