Skip to content

Instantly share code, notes, and snippets.

View jackyu1996's full-sized avatar
๐ŸŽ‡

Jack Yu jackyu1996

๐ŸŽ‡
View GitHub Profile
@jackyu1996
jackyu1996 / downloadNlcPdf.sh
Created March 24, 2023 15:41
Download pdf files from read.nlc.cn with aid and bid
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
downloadPdfWithAidAndBid() {
keys='tokenKey="([A-F0-9]+)".*timeKey="([0-9]+)".*timeFlag="([0-9]+)"'
requestKeyResult=$(curl "http://read.nlc.cn/OutOpenBook/OpenObjectBook?aid=$1&bid=$2")
[[ $requestKeyResult =~ $keys ]]
@jackyu1996
jackyu1996 / ublock-remove-seo-list
Last active August 9, 2023 02:48
To hell with your SEO and Ads.
google.*##.g:has(a[href*="x-mol.com"])
google.*##.g:has(a[href*="drivereasy.com"])
google.*##.g:has(a[href*="baidu.hk"])
google.*##.g:has(a[href*="xukeng.com"])
google.*##.g:has(a[href*="dict.cn"])
google.*##.g:has(a[href*="ichacha.net"])
google.*##.g:has(a[href*="hujiang.com"])
google.*##.g:has(a[href*="penhen.com"])
google.*##.g:has(a[href*="pianbiao.com"])
google.*##.g:has(a[href*="dictall.com"])
@jackyu1996
jackyu1996 / scel.py
Created November 22, 2019 08:13
Scel Reader for Python, direct invocation will generate dictionary for Rime
#!/usr/bin/env python
import os
def decode_bytes(data: bytes) -> str:
return data.decode("utf-16-le")
@jackyu1996
jackyu1996 / trello_show_card_short_id.user.js
Created July 29, 2019 14:18
Show Trello Card Short ID
// ==UserScript==
// @name Trello Show Card Short ID
// @version 1
// @grant none
// @include https://trello.com/b/*
// @run-at document-idle
// ==/UserScript==
(function(){
@jackyu1996
jackyu1996 / hotkey.json
Last active August 1, 2019 02:08
Sane Aegisub Hotkey Config
{
"Default" : {
"app/options" : [
"Alt-O"
],
"automation/lua/trim-lines/Trim Lines" : [
"Ctrl-Shift-S"
],
"edit/find_replace" : [
"Ctrl-F"
@jackyu1996
jackyu1996 / list_length.ps1
Created May 16, 2019 15:18
Use powershell to list all recordings(m4a,mp3) length and output to an csv file
$FileHT = @{}
$Folder = Convert-Path "."
foreach ($file in Get-ChildItem -Recurse -Include *.m4a,*.mp3 -Path $Folder) {
$Name = $file.Name
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.Namespace($Folder)
$objFile = $objFolder.ParseName($Name)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>So, You Like Classical Music</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css" integrity="sha256-OweaP/Ic6rsV+lysfyS4h+LM6sRwuO3euTYfr6M124g=" crossorigin="anonymous" />
</head>
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font">
<edit mode="assign" name="autohint">
<bool>true</bool>
</edit>
<edit mode="assign" name="hinting">
<bool>true</bool>
</edit>
@jackyu1996
jackyu1996 / index.html
Last active January 4, 2018 05:08
Simple pure css dropdown nav bar
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="wilih=device-wilih" />
<title>Test Page</title>
<link rel="stylesheet" href="style.css" type="text/css" media="all" />
</head>
@jackyu1996
jackyu1996 / HBUE_PJ.js
Created June 5, 2017 05:31
A little help for HBUEr
var excellent = $('[data-dyf="95"]');
var good = $('[data-dyf="85"]');
var random = Math.max(1, Math.floor(Math.random() * good.length));
for (i = 0; i < excellent.length; i++) {
excellent[i].checked = true;
};
good[random].checked = true;
$("#btn_xspj_bc").click();