Skip to content

Instantly share code, notes, and snippets.

View hguandl's full-sized avatar

Hao Guan hguandl

  • Shenzhen, China
View GitHub Profile
@hguandl
hguandl / client_provider.rs
Created August 31, 2022 05:27
Rust client provider demo
use lazy_static::lazy_static;
use reqwest::Client;
use tokio::sync::{Mutex, MutexGuard};
pub struct ClientProvider {
client: Mutex<Client>,
}
impl ClientProvider {
pub fn new() -> Self {
//
// ContentView.swift
// Shared
//
// Created by hguandl on 28/8/2022.
//
import AVFoundation
import SwiftUI
@hguandl
hguandl / mv3.ipynb
Last active October 21, 2021 21:07
Reproduction of MobileNetV3 error
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hguandl
hguandl / NetworkChangeDetector-main.swift
Last active June 3, 2023 17:13
Detect network changes on macOS
//
// main.swift
// NetworkChangeDetector
//
// Created by Hao Guan on 2021/8/30.
//
import Foundation
import Network
import CoreWLAN
@hguandl
hguandl / bili-new-live-cleaner.user.js
Created July 16, 2021 12:55
删除哔哩哔哩直播中的新版直播间相关内容
// ==UserScript==
// @name Bilibili New Live Cleaner
// @namespace https://hguandl.com
// @version 0.1
// @description 删除哔哩哔哩直播中的新版直播间相关内容
// @author hguandl
// @match *://link.bilibili.com/p/center/index*
// @icon https://www.bilibili.com/favicon.ico
// @grant none
// ==/UserScript==
@hguandl
hguandl / weibo_watcher.py
Created February 8, 2021 12:32
Watch for new weibo and push notifications
#!/usr/bin/env python3
"""
Copyright (c) 2020 Hao Guan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@hguandl
hguandl / ak_face_downloader.py
Last active March 6, 2024 02:45
Arknights Official QQ Emoji Downloader
#!/usr/bin/env python3
import requests
import json
import os
"""""""""""""""""""""""""""""""""""""""
Please enter your cookies below
after login in https://i.qq.com
"""
#!/usr/bin/env python3
import os
import xattr
APP_DIR = "/Applications"
ATTR = "com.apple.quarantine"
def remove_r(path: str):
if ATTR in xattr.listxattr(path):