Skip to content

Instantly share code, notes, and snippets.

View NeraSnow's full-sized avatar

Benjamin Chen NeraSnow

View GitHub Profile
@NeraSnow
NeraSnow / note.md
Created January 30, 2024 04:00
LaTeX2HTML

\\item (.*)$

$1

@NeraSnow
NeraSnow / README.md
Created December 27, 2023 09:47
μTorrent DNS Blocking List

Based on SeaHOH/ban-peers#1

With Regex:

.*\.utorrent\.li
.*\.pdate\.utorrent\.com
.*\.pdate\.bittorrent\.com
.*\.tclient\.utorrent\.com
.*\.ishes\.utorrent\.com
.*\.aptor\.utorrent\.com
@NeraSnow
NeraSnow / index.js
Created December 25, 2023 05:46
LeetCode Get Question Topics
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 2023-12-25
// @description try to take over the world!
// @author You
// @match https://leetcode.com/problems/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=leetcode.com
// @grant none
// ==/UserScript==
@NeraSnow
NeraSnow / README.md
Created December 14, 2023 00:32
Tweaking CSS files of SICP for Ebook Readers

Introduction

We have this wonderful SICP (Structure and Interpretation of Computer Programs) Ebook Project. But the epub ebook file created is catered for colored screens. Some of the default color schemes are not great for Ebook readers. I did the following things to make the epub version of the SICP more suitable for Ebook readers.

I am using Calibre to edit the epub file. I am satisfied with the result. Please let me know if there is anything that should also be changed.

Changes

prettify.css

@NeraSnow
NeraSnow / README.md
Created December 13, 2023 23:02
OSTEP Creating Bookmarks Notes

Obtain the table of contents from copy and pasting (through the PDF viewer (pdf.js seems to be working the best for me))

Work in progress...

Using regular expressions to clean up the table of contents:

^(.*)$ to +$1 # add a + to the beginning of each line
^(.* )([1-9]|[1-9][0-9]|[1-9][0-9][0-9])$ to $1|$2 # add a | before the page number
^(.*)( \.)+(.*)$ to +$1$2$3 # indicate it is the 2nd level of bookmark
 \. to '' # remove the ". "
@NeraSnow
NeraSnow / filter.js
Created December 7, 2023 01:36
Filtering HTML table
// Replace 'table' with the actual ID or class of your HTML table
var table = document.querySelector('table');
// Replace 1 with the index of the column you want to filter (indexing starts from 0)
var columnIndex = 3;
// Replace 'example' with the text you want to filter
var searchText = 'example';
for (var i = 1, row; row = table.rows[i]; i++) {
@NeraSnow
NeraSnow / inject.js
Created August 17, 2023 18:56
Crowdmark Marking Modifications
document.getElementsByClassName("grading-toolbar__tool--box")[0].onclick = function() {scrollBy(0, 91)}
@NeraSnow
NeraSnow / gist:62245875483c8b5e5e27ca40ccc039f3
Created January 8, 2023 00:03
Outlook Archive Old Emails VBA Script
Sub MoveAgedMail()
Dim objOutlook As Outlook.Application
Dim objNamespace As Outlook.NameSpace
Dim objSourceFolder As Outlook.MAPIFolder
Dim objDestFolder As Outlook.MAPIFolder
Dim objVariant As Variant
Dim lngMovedItems As Long
Dim intCount As Integer
Dim intDateDiff As Integer
@NeraSnow
NeraSnow / 九八新闻台_fetchRSS.py
Created August 20, 2022 01:08
Podcast Fetching Scripts
import feedparser
import urllib
import requests
import sys
import os
import re
import subprocess
ParentPath = '/u/USER_ID/public_html/Podcast/九八新闻台/'
RSSFeed = 'https://feeds.soundcloud.com/users/soundcloud:users:496937352/sounds.rss'
@NeraSnow
NeraSnow / MapleTeXOutputColoring.sh
Last active March 12, 2022 23:44
Maple TeX Output Customize
sed -i '/\\begin{dmath}/s/$/ \\color{blue}/' q1.tex