Skip to content

Instantly share code, notes, and snippets.

View johnroyer's full-sized avatar

Zero Huang johnroyer

View GitHub Profile
@johnroyer
johnroyer / forgejo-workflow.yaml
Created January 11, 2025 06:11
Forgejo Runner config
on: [push]
jobs:
"check PHP PSR":
runs-on: ubuntu-22.04
steps:
- name: "check out source code"
uses: "https://code.forgejo.org/actions/checkout@v4"
- name: "setup PHP"
uses: "shivammathur/[email protected]"
@johnroyer
johnroyer / tempermonkey-script.js
Created March 23, 2025 10:17
Remove YouTube video on the top of NewsTalk
// ==UserScript==
// @name Remove YouTube video on the top of NewsTalk
// @namespace https://newtalk.tw/
// @version 0.1
// @description remove the ads on the top
// @author zeroplex
// @match https://newtalk.tw/news*
// @run-at document-end
// @grant none
// ==/UserScript==
@johnroyer
johnroyer / gist:c41dd6030065a274376fcc16af5a8722
Created April 28, 2025 09:52
Nginx config example for blocking bots
server {
if ($http_user_agent ~* (mj12bot|ahrefs|imagesift|BLEXBot|webmeup|toutiao|semrush|petalsearch|dataforseo)) {
return 402;
}
}