Skip to content

Instantly share code, notes, and snippets.


cosven cosven

Block or report user

Report or block cosven

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
cosven /
Created Mar 18, 2019
qt qtableview macOS mojave dark mode bug
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
class Model(QAbstractTableModel):
def __init__(self):
self._data = ['miao', 'hello', 'world']
cosven /
Last active Jan 29, 2020
mpvwidget implemented with PyQt5 and QOpenGLWidget (currently used in
# 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 / .dir-locals.el
Last active Nov 21, 2018
Emasc Python 项目 .dir-locals.el 示例
View .dir-locals.el
;; 激活 pyvenv-mode,也可以自己在 init.el 中默认激活
(eval . (pyvenv-mode))
;; 这个要写绝对路径
(pyvenv-activate . "/Users/cosven/projectpath/.venv")
;; 默认 select python-pylint 这个 checker
cosven / nginx.conf
Last active Aug 22, 2018
Django 项目部署示例
View nginx.conf
server {
listen 80;
# path for static files
location /static/ {
root /data/static;
cosven /
Created Aug 3, 2018
从网页端控制 feeluown 示例
- pip3 install flask # 安装依赖
- python3 # 启动网页,在浏览器
import socket
from flask import Flask, request
cosven /
Last active Mar 2, 2019
FeelUOwn 内存使用分析

FeelUOwn 内存使用分析

2019-03-03 再次测试结论

mpv37import + init
cosven /
Last active Oct 2, 2018
how gevent works?
# gevent from the ground up - demo 1
import selectors
import socket
import time
from urllib.parse import urlparse
sel = selectors.DefaultSelector()
cosven / fonts.conf
Created Jul 17, 2018
KDE 下 fonts.conf 配置示例,有两个效果:让 chromium 正确的显示中文字体;konsole 正确的显示中文字体,并且支持显示 Emoji
View fonts.conf
<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- <dir>~/.fonts</dir> -->
<family>Noto Serif CJK SC</family>
<family>Noto Color Emoji</family>
cosven /
Created Jun 30, 2018
feeluown 项目一些废弃代码
def contextMenuEvent(self, event):
menu = QMenu()
index = self.indexAt(event.pos())
song = self.model().data(index, Qt.UserRole)
if song.album:
show_album_action = QAction('专辑:{}'.format(, menu)
partial(self.show_album_needed.emit, song.
cosven /
Created Apr 27, 2018
leetcode subtree visualization
import random
from graphviz import Digraph
# Definition for a binary tree node.
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
You can’t perform that action at this time.