Skip to content

Instantly share code, notes, and snippets.

View JonyFang's full-sized avatar
:octocat:
Focusing

JonyFang JonyFang

:octocat:
Focusing
View GitHub Profile
@jason5ng32
jason5ng32 / surge.conf
Last active April 7, 2024 13:04
Surge Configs ( for 2.x )
[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = PASSWORD@0.0.0.0:6155
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD
@cupof-github
cupof-github / guetzli.py
Last active May 8, 2017 05:01
Guetzli wrapper for Python
import os
import sys
class GuentzliWrapper:
""" This Class is wrapper for the guentzli, google develped.
You can encode multiple (jpeg || png) file via guentzli on CLI.
( Tested: Python 3.6, 2.7.13, pypy 5.7.0)
// Note that this checker is always running, even when the app is in the background (where it doesn't matter if the main thread is blocked)
// You'll have to add more code if you don't want the checker to run while the app is in the background
final class ANRChecker {
private let ANRThreshold: CFTimeInterval = 5
// This variable may be accessed from multiple threads at the same time. It won't cause issues, but if you want prevent the thread sanitizer from complaining, you can add locking around it or w/e
private lazy var lastResponseTime: CFTimeInterval = CACurrentMediaTime()
func beginChecking() {
updateLastResponseTime()
var sessions = []
var sessionsNodes = document.querySelectorAll("#sessions section.video-container")
for (var i=0;i<sessionsNodes.length;i+=1) {
var section = sessionsNodes[i]
var date = section.querySelector("section.sticky section section section span span").textContent
var sessionsInDateNodes = section.querySelectorAll("ul.videos li.video div.grid div.row")
var sessionsInDate = []