Skip to content

Instantly share code, notes, and snippets.

View Senorsen's full-sized avatar
👋
Hello

Sen Zhang Senorsen

👋
Hello
View GitHub Profile
@taowen
taowen / extractTextFromPdf.md
Last active April 15, 2024 08:14
extract text from pdf

这个是油猴脚本。安装了暴力猴插件之后,点击上面这个文件的 Raw 按钮,会提示安装。

实现原理

  • pdf.js 可以提取所有的 TextItem 包括文本和包围盒
  • 根据包围盒可以大致判断一下是否换行了
  • 如果一行中包含了公式,那么一行会有很多个 TextItem,这些行会称之为 complex 的行
  • 多个连续的 complex 行变成了 complex 块
  • 如果有 claude 3 haiku 的账号会对 complex 块做一次基于图片的 OCR 来清洗嘈杂的带公式的文本
@usagimaru
usagimaru / HiddenMacOSDebuggingPanel.md
Last active May 8, 2024 01:19
Enables useful debugging panel in macOS apps

Use _NS_4445425547 or NS🐞 for enables debuggging panel. When enabled it, a ladybug 🐞 menu appears in the app menu bar.

“4445425547” means DEBUG in Unicode table.

0x44=D
0x45=E
0x42=B
0x55=U
0x47=G

@XieJiSS
XieJiSS / userscript.js
Last active May 9, 2024 06:48
CC98 remove watermark tampermonkey userscript
// ==UserScript==
// @name No Watermark CC98
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Remove CC98 watermark
// @author who cares?
// @license WTFPL
// @run-at document-start
// @match https://www.cc98.org/*
// @icon https://www.cc98.org/static/98icon.ico
@huytd
huytd / wordle.md
Last active May 16, 2024 20:39
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@namidairo
namidairo / pppd-cve.py
Last active January 25, 2022 08:05
Xiaomi RM2100 1.0.14 vs. CVE-2020-8597
from scapy.all import *
from socket import *
interface = "enp0s31f6"
def mysend(pay,interface = interface):
sendp(pay, iface = interface)
def packet_callback(packet):
@BenjaminPoncet
BenjaminPoncet / ffmpeg-wrapper
Last active March 29, 2024 10:11
Synology VideoStation ffmpeg wrapper with DTS, EAC3 and TrueHD support. This project is no longer maintained: Please see the following projects: https://github.com/darknebular/Wrapper_VideoStation/ - https://github.com/AlexPresso/VideoStation-FFMPEG-Patcher
#!/bin/bash
rev="12"
_log(){
echo "$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - $1" >> /tmp/ffmpeg.log
}
_log_para(){
echo "$1" | fold -w 120 | sed "s/^.*$/$(date '+%Y-%m-%d %H:%M:%S') - ${streamid} - = &/" >> /tmp/ffmpeg.log
@paulstuart
paulstuart / flatten.sh
Created June 25, 2019 19:18
A script to "flatten" and "unflatten" JSON structures
#!/bin/bash
# Convert json data to a dotted notation for line-based manipulation and visualization
#
# Adapted from dialog here: https://news.ycombinator.com/item?id=20245913
# jq code by @jolmg
#
flat() {
jq -r '
@aveao
aveao / amsemummc.md
Last active March 12, 2020 15:45
setting up ams partition based emummc on linux

Setting up emummc in a nutshell (mostly for linux)

  • update atmosphere to 0.9.2 on your microsd. Also ensure that your microSD is MBR, not GPT (gparted calls this msdos).
  • if you want to use an old backup, grab those files, you'll need them. If not, boot into hekate, dump raw gpp and boot0/1.
  • combine all files on your pc, in the order of boot0, boot1 and rawnand (cat BOOT0 BOOT1 rawnand.bin.00 rawnand.bin.01 rawnand.bin.02 rawnand.bin.03 rawnand.bin.04 rawnand.bin.05 rawnand.bin.06 rawnand.bin.07 rawnand.bin.08 rawnand.bin.09 rawnand.bin.10 rawnand.bin.11 rawnand.bin.12 rawnand.bin.13 rawnand.bin.14 > emummc.bin). Resulting file should be 31276924928 bytes unless you modded your console with a larger (or a smaller) emmc (if you don't know what this is about, then you haven't modded yours).
  • create a fat32 partition on your microsd of the same size as the resulting file you just created (can be a bit bigger, do it a bit [100MiB or so] bigger if you want to be safe), dd the combined file to it with
@Jimmy-Z
Jimmy-Z / services-start.sh
Created February 28, 2019 08:42
multi SSID with VLAN script, for ASUS AC86U with merlin
#!/bin/sh
# multi SSID with VLAN script, for ASUS AC86U with merlin
#
# setup before hand:
# set "router" to "AP Mode"
# this will put all ports and wireless in br0
# create 2 guest network
# enable Administration => System => Enable JFFS custom scripts and configs
# put this script in /jffs/scripts/, name should be "services-start"