Skip to content

Instantly share code, notes, and snippets.

jamiesun jamiesun

Block or report user

Report or block jamiesun

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
alex-spataru / A QML Material
Last active Oct 13, 2019
Implementation of a simple and clean Material drawer for your QtQuick/QML applications
View A QML Material


This gist allows you to implement a material drawer easily for your projects. It consists of three files:

  • PageDrawer.qml The drawer itself, with an icon viewer, a list view and some hacks to execute the actions/functions assigned to each drawer item
  • DrawerItem.qml Which can act as an action, a spacer, a separator or a link
  • SvgImage.qml Ugly hack to make SVG images look crisp and smooth on HDPI screens

Example project screenshot


vxgmichel /
Last active Oct 15, 2019
High-level UDP endpoints for asyncio
"""Provide high-level UDP endpoints for asyncio.
async def main():
# Create a local UDP enpoint
local = await open_local_endpoint('localhost', 8888)
# Create a remote UDP enpoint, pointing to the first one
ficapy /
Last active Aug 24, 2019
# !/usr/bin/env python
# -*- coding: utf-8 -*-
from Crypto.Cipher import PKCS1_v1_5
from Crypto.PublicKey import RSA
from Crypto.Hash import SHA
from Crypto import Random
from Crypto.Cipher import AES
aes_obj_enc ='This is a key123', AES.MODE_CBC, 'This is an IV456')
yyang /
Last active Oct 11, 2018
centos 7 pptpd firewalld
# pptpd installation script on my own CentOS 7 box.
# inspired by:
# and
# Author: 2015 Steve Yang <>
# The script comes with ABSOLUTELY NO WARRANTY.
wjp2013 / wechat-useragent.js
Created Mar 6, 2015
View wechat-useragent.js
// 检测浏览器的 User Agent 应该是非常简单的事情
// 微信在 Android 下的 User Agent
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/
// 微信在 iPhone 下的 User Agent
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0
// 通过javascript判断
// 很容易看出来,微信的 User Agent 都有‘micromessenger’字符串标示,我们判断是否含有这些字符串就OK了
function isWeixinBrowser(){
jamiesun / check_temp
Created Jun 4, 2014
nagios coretemp check
View check_temp
import re
import os
import sys
import syslog
from optparse import OptionParser
jamiesun /
Created Jul 12, 2012
#! /usr/bin/env python2.7
import sys
import os
import time
import atexit
from signal import SIGTERM
hongqn / gist:1758954
Created Feb 7, 2012
A benchmark tool in eventlet
View gist:1758954
#!/usr/bin/env python
# encoding: UTF-8
__author__ = "Qiangning Hong <>"
__version__ = "$Revision: 51434 $"
__date__ = "$Date: 2010-11-17 17:44:38 +0800 (Wed, 17 Nov 2010) $"
import sys
ipconfiger /
Created Jan 5, 2012
# -*- Encoding: utf-8 -*-
import base64
import binascii
import cgi
import hashlib
import hmac
import logging
import time
import urllib
import urlparse
anonymous /
Created Nov 19, 2011
Test script showing usage of a buffering SMTP handler.
#!/usr/bin/env python
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved.
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of Vinay Sajip
# not be used in advertising or publicity pertaining to distribution
You can’t perform that action at this time.