Skip to content

Instantly share code, notes, and snippets.

View wizyoung's full-sized avatar
🎯
May be slow to respond

Wizyoung wizyoung

🎯
May be slow to respond
View GitHub Profile
@wizyoung
wizyoung / benchmark_flce.py
Last active November 18, 2024 13:49
chunked_lce.py
import sys
sys.path.append('.')
import argparse
import csv
import json
import os
import time
from typing import Any, Callable, Dict, List, Optional, Union
from collections import OrderedDict
from dataclasses import asdict, dataclass
@wizyoung
wizyoung / RemoveAd10jqka.stoverride
Last active October 17, 2023 11:13
同花顺去开屏广告
name: 同花顺去开屏广告
desc: 同花顺去开屏广告
http:
mitm:
- "adm.10jqka.com.cn"
- "stat.10jqka.com.cn"
rewrite:
- ^https?:\/\/adm\.10jqka\.com\.cn\/img\/ad\/.* - reject
- ^https?:\/\/adm\.10jqka\.com\.cn\/interface\/getads\.php - reject
@wizyoung
wizyoung / modified-zotselect-link.js
Created March 22, 2022 08:24 — forked from masnick/modified-zotselect-link.js
Zotero export translator for getting zotero:// link and article information
-- Run the following cmd to make Transmit marry iterm2 as its Terminal partner:
-- defaults write com.panic.Transmit OpenTerminalScriptPath ~/transmit-iterm-patch.applescript
on openTerminal(location, remoteHost, serverPort)
-- Prepare sshCmd and cmd:
set sshCmd to ""
set cmd to "cd \"" & location & "\""
if ((count of remoteHost) is greater than 0) then
set sshCmd to "ssh " & remoteHost
@wizyoung
wizyoung / homebrew-gnubin.md
Created March 21, 2020 12:54 — forked from skyzyx/homebrew-gnubin.md
Using GNU command line tools in macOS instead of FreeBSD tools

macOS is a Unix, and not built on Linux.

I think most of us realize that macOS isn't a Linux OS, but what that also means is that instead of shipping with the GNU flavor of command line tools, it ships with the FreeBSD flavor. As such, writing shell scripts which can work across both platforms can sometimes be challenging.

Homebrew

Homebrew can be used to install the GNU versions of tools onto your Mac, but they are all prefixed with "g" by default.

All commands have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc.

@wizyoung
wizyoung / TransmitOpenTerminal.txt
Last active March 19, 2020 12:29 — forked from johnfmorton/TransmitOpenTerminal.txt
transmit open in iterm2
on openTerminal(location, remoteHost, serverPort)
tell application "System Events"
-- some versions might identify as "iTerm2" instead of "iTerm"
set isRunning to (exists (processes where name is "iTerm")) or (exists (processes where name is "iTerm2"))
end tell
tell application "iTerm"
activate
set targetTab to ""