Skip to content

Instantly share code, notes, and snippets.

View cosven's full-sized avatar
🍊

Shaowen Yin cosven

🍊
View GitHub Profile
@cosven
cosven / switch-omega
Last active September 18, 2023 02:20
switch omega bypass list
127.0.0.1
172.*.*.*
192.*.*.*
10.*.*.*
82.157.25.86
39.106.86.136
152.136.199.195
::1
localhost
arch
@cosven
cosven / blur_widget.py
Created June 29, 2023 16:02
PyQt5 blur widget
class BlurWidget(QWidget):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
effect = QGraphicsBlurEffect(self)
effect.setBlurRadius(120)
self.setGraphicsEffect(effect)
self.parent().installEventFilter(self)
@cosven
cosven / main.py
Last active May 12, 2022 02:20
macOS nowplaying implemented in pyobjc
from Foundation import NSRunLoop, NSMutableDictionary, NSObject
from MediaPlayer import MPRemoteCommandCenter, MPNowPlayingInfoCenter
from MediaPlayer import (
MPMediaItemPropertyTitle, MPMediaItemPropertyArtist,
MPMusicPlaybackState, MPMusicPlaybackStatePlaying, MPMusicPlaybackStatePaused
)
class No
@cosven
cosven / main.swift
Created May 11, 2022 08:01
macOS nowplaying for FeelUOwn
import Foundation
import MediaPlayer
import Network
let cmdCenter = MPRemoteCommandCenter.shared()
cmdCenter.togglePlayPauseCommand.addTarget{ (e) -> MPRemoteCommandHandlerStatus in
return .success
}
import Foundation
import MediaPlayer
import Network
let cmdCenter = MPRemoteCommandCenter.shared()
cmdCenter.togglePlayPauseCommand.addTarget{ (e) -> MPRemoteCommandHandlerStatus in
return .success
}
@cosven
cosven / asyncio_douban_zufang.py
Last active March 14, 2022 09:46
北京豆瓣租房小脚本...
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
豆瓣租房爬虫
Install:
pip install beautifulsoup4
Usage:
@cosven
cosven / mac_global_hotkey.py
Last active January 8, 2022 13:59
OSX global hotkeys via python.
# -*- coding: utf-8 -*-
"""
Dependency::
pip3 install pyobjc-framework-Cocoa
pip3 install pyobjc-framework-Quartz
Usage::
@cosven
cosven / mpv_qtwidget_opengl.py
Last active December 15, 2021 23:16
mpvwidget implemented with PyQt5 and QOpenGLWidget (currently used in http://github.com/cosven/feeluown)
# BSD 3-Clause License
#
# Copyright (c) 2020, Cosven
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
@cosven
cosven / xiami_to_fuo_collection.py
Last active January 5, 2021 05:38
导出虾米歌单到 ~/.FeelUOwn/collections 目录并自动刷新 UI,运行方式:fuo exec < xiami_to_fuo_collection.py
import os
from tomlkit import document, value, dumps
from fuocore.models.uri import reverse
from fuo_xiami import provider
user = provider._user
if user is None:
raise Exception('你可能没有登录')
@cosven
cosven / demo.py
Last active December 8, 2020 15:15
feeluown models v2 - demo
from typing import List
class SongDisplayModel:
pass
class SongModel:
pass