Skip to content

Instantly share code, notes, and snippets.

View jostyee's full-sized avatar
💭
脑壳疼

Josta Yee jostyee

💭
脑壳疼
  • Singapore
View GitHub Profile
@jostyee
jostyee / gbkzip.py
Created March 9, 2018 04:44
gbkzip - unzip Windows zip file and convert gbk to utf8 using Python 3
#!/usr/bin/env python
#-*- coding:utf8 -*-
'''
YUCOAT的原脚本只适用于Python 2,改了下Python 3的版本
'''
import os
import sys
import zipfile
if __name__ == '__main__':
@jostyee
jostyee / go.xml
Created July 11, 2020 12:52 — forked from sha1sum/go.xml
GOlang File Format for Beyond Compare
<?xml version="1.0" encoding="UTF-8"?>
<!-- Produced by Beyond Compare 4 from Scooter Software -->
<!--
This is an extension of the work done by Nate Finch:
https://npf.io/2014/05/diffing-go-with-beyond-compare/
The regular expressions for identifiers have been updated
to match on lowercase and allow numbers to be included anywhere
after the first character of the word.
@jostyee
jostyee / Translate with DeepL with hotkey.kmmacros
Created November 7, 2021 06:12
Keyboard Maestro macro: translate selected text with DeepL
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>657891648.46214402</real>
<key>Macros</key>
adss.video.qq.com
bugly.qq.com
dp3.qq.com
fusion.qq.com
pingtas.qq.com
huatuocode.weiyun.com
report.huatuo.qq.com
vd.l.qq.com
nex.163.com
sentry.music.163.com
@jostyee
jostyee / quantumult_filter.conf
Last active September 22, 2021 02:27
Rules for Quantumult app
// DEPRECATED, prefer https://gist.githubusercontent.com/jostyee/5d1f840bd8fd4ac53778a91ce13323b6/raw/quantumult_filter_select.conf
#!/bin/sh
INSTALL_DIR="/etc/dnscrypt-proxy"
LATEST_URL="https://api.github.com/repos/jedisct1/dnscrypt-proxy/releases/latest"
Update() {
workdir="$(mktemp -d)"
curl -sL $(curl -sL "$LATEST_URL" |
grep dnscrypt-proxy-linux_arm64- | grep browser_download_url | head -1 | cut -d \" -f 4) |
tar xz -C "$workdir" -f - linux-arm64/dnscrypt-proxy &&
@jostyee
jostyee / goodreads_to_book_track.py
Created August 5, 2020 08:44 — forked from ahmedre/goodreads_to_book_track.py
Goodreads export to Book Track friendly Importer
import csv
import requests
import sys
"""
This script converts a Goodreads export csv into a Book Track friendly csv.
It does this by querying Google Books' api for each book and adding its id,
along with removing some of the other unnecessary fields in the original
export.
@jostyee
jostyee / pi.status.sh
Created May 16, 2020 14:38 — forked from dchakro/pi.status.sh
Shell script to print stats about a Raspberry running pihole
# Gather system details.
dt=$(date -R)
freq=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq)
volts=$(sudo /opt/vc/bin/vcgencmd measure_volts)
temp=$(sudo /opt/vc/bin/vcgencmd measure_temp)
gov=$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor)
up=$(uptime)
# Print System details
echo " "
@jostyee
jostyee / karabiner_merge.sh
Created June 11, 2019 14:53 — forked from narze/karabiner_merge.sh
Merge karabiner.json with complex modification rules
#!/usr/bin/env bash
# Requirements : goku, jq
# 1. Make sure goku runs
goku
# 2. Make temp json file
cp ~/.config/karabiner/karabiner.json ~/.config/karabiner/karabiner.tmp.json
@jostyee
jostyee / pi-hole.sh
Created March 27, 2019 09:37
Run pi-hole in macOS
#!/bin/bash
# https://github.com/pi-hole/docker-pi-hole/blob/master/README.md
docker run -d \
--name pihole \
-p 53:53/tcp -p 53:53/udp \
-p 80:80 \
-p 443:443 \
-e ServerIP="$(ipconfig getifaddr en0)" \