Skip to content

Instantly share code, notes, and snippets.

View ricky9w's full-sized avatar
🏠
Working from home

Richard Wang ricky9w

🏠
Working from home
View GitHub Profile
@ricky9w
ricky9w / waf-block-chinese-browsers.lua
Created April 24, 2025 17:09
Blacklist of user agent strings for Cloudflare WAF targeting Chinese browsers/apps/devices/spiders
(http.user_agent contains "360")
or (http.user_agent contains "360SE")
or (http.user_agent contains "360EE")
or (http.user_agent contains "360AI")
or (http.user_agent contains "360ENT")
or (http.user_agent contains "QHBrowser")
or (http.user_agent contains "QihooBrowser")
or (http.user_agent contains "UCBrowser")
or (http.user_agent contains "UCWEB")
or (http.user_agent contains "UBrowser")
@ricky9w
ricky9w / sohu-hide-distractions.user.js
Created March 21, 2025 12:35
Remove Sohu pop-ups and slide-bar ads
// ==UserScript==
// @name Sohu Hide Distractions
// @version 0.1
// @description Remove Sohu pop-ups and slide-bar ads
// @author ricky9w
// @match https://www.sohu.com/a/*
// @grant none
// ==/UserScript==
(function() {
@ricky9w
ricky9w / keep-bilibili-subtitle.js
Created September 3, 2024 07:24
自动记忆并应用哔哩哔哩视频字幕的开关状态,在观看多P视频时保持一致的字幕设置
// ==UserScript==
// @name Bilibili字幕状态记忆
// @namespace http://tampermonkey.net/
// @version 0.4
// @description 自动记忆并应用哔哩哔哩视频字幕的开关状态,在观看多P视频时保持一致的字幕设置
// @author Richard Wang
// @email [email protected]
// @match *://www.bilibili.com/video/*
// ==/UserScript==
@ricky9w
ricky9w / XHS-Downloader.js
Created August 2, 2024 13:45
下载小红书无水印图文/视频作品
// ==UserScript==
// @name XHS-Downloader
// @namespace https://github.com/ricky9w
// @version 1.4.1
// @description 下载小红书无水印图文/视频作品
// @author JoeanAmier (improved and compiled by ricky9w & Claude AI)
// @match http*://www.xiaohongshu.com/*
// @grant GM_getValue
// @grant GM_setValue
// @grant unsafeWindow
@ricky9w
ricky9w / HumidityCalculator.tsx
Created August 1, 2024 20:18
A Next.js component that calculates the amount of water needed to adjust room humidity
import React, { useState } from 'react';
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
import { Input } from "@/components/ui/input"
import { Button } from "@/components/ui/button"
import { Label } from "@/components/ui/label"
const HumidityCalculator = () => {
const [temperature, setTemperature] = useState('');
const [currentHumidity, setCurrentHumidity] = useState('');
const [targetHumidity, setTargetHumidity] = useState('');
@ricky9w
ricky9w / HideAdsFromGoogleSearch.js
Created July 31, 2024 06:38
Hide 'Sponsored' results from Google search results
// ==UserScript==
// @name Hide Ads From Google Search Page
// @description Hide 'Sponsored' results from Google search results
// @match https://www.google.com/search*
// ==/UserScript==
(function() {
'use strict';
// Function to hide elements
@ricky9w
ricky9w / SohuHideDistractions.js
Created July 19, 2024 07:41
Remove Sohu pop-ups and slide-bar ads
// ==UserScript==
// @name Souhu Hide Distractions
// @version 0.1
// @description Remove Sohu pop-ups and slide-bar ads
// @author ricky9w
// @email [email protected]
// @match https://www.sohu.com/a/*
// @grant none
// ==/UserScript==
@ricky9w
ricky9w / scrollable-to-screenshot.js
Created July 17, 2024 07:23
Create a long screenshot of all elements in a scrollable container
// ==UserScript==
// @name Long Screenshot Creator for Scrollable Container
// @namespace https://rikko.top
// @version 0.1
// @description Create a long screenshot of all elements in a scrollable container
// @author ricky9w
// @email [email protected]
// @match https://*/*
// @grant none
// @require https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js
@ricky9w
ricky9w / README.md
Last active November 15, 2022 14:45
Bash script for a comprehensive stress testing on CPU, memory, system I/O and disk

Comprehensive Stress Testing

Comprehensive stress testing on CPU, memory, system I/O and disk

Dependencies

  • stress
  • jq
  • lm-sensors
@ricky9w
ricky9w / intro-to-software-building.org
Created April 14, 2022 17:52
Basic concepts of software building tools, introduction to Make and CMake

Introduction to Software Building

Introduction

Make, Ninja, Ant, Gradle, MSVC are some of the build systems. They help us to drive the compiler and other build tools. You may need to write a ‘build file’ to tell them the dependency information for them to build a software.

While this is already very convenient, the building of C/C++ projects is not standard across the platforms. Then you may need a ‘meta-build system’ to help you generate ‘build’ files for different build systems.

CMake is such a ‘meta-build system’ that can generate platform based system files by setting some flags.

See this article about the details of a buildsystem: What Is a Build System? - Scott Dorman