Skip to content

Instantly share code, notes, and snippets.

Avatar

Dreampuf dreampuf

View GitHub Profile
@dreampuf
dreampuf / gist:4223370
Created Dec 6, 2012
ab Benchmark plot
View gist:4223370
# output as png image
set terminal png
# save file to "benchmark.png"
set output "benchmark.png"
# graph title
set title "Benchmark for gunicorn(default) vs. gunicorn(gevent) vs. gunicorn(eventlet) vs. Flask default"
# aspect ratio for image size
@dreampuf
dreampuf / buyvm.net.py
Created Dec 12, 2012
Interval tool for check buyvm.net activate Instance send email to inform your by email
View buyvm.net.py
#!/usr/bin/env python
#vi: encoding=utf-8
""" Interval tool for check buyvm.net activate Instance send email to inform your by email
http://huangx.in
"""
import time
import json
import urllib2
View sqlite3_wal_test.py
import time
from playhouse.sqlite_ext import SqliteExtDatabase
sqlite_db = SqliteExtDatabase('my_app.db', journal_mode="WAL", autocommit=False)
with sqlite_db.transaction() as cursor:
cursor = sqlite_db.execute_sql("""CREATE TABLE server_status (
id INTEGER PRIMARY KEY,
time_created INT);""")
assert cursor.rowcount == -1
@dreampuf
dreampuf / build_python_rpm_package.sh
Created Nov 25, 2015
Build yourself Python 2.7 rpm package in RHEL5/CENTOS5
View build_python_rpm_package.sh
# 1. install pyenv and with it download python 2.7.10
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
exec $SHELL
pyenv install 2.7.10
pyenv rehash
# 2. install rvm and fpm gem package
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
View gist:4328605

诚邀顶级的java程序猿参加一项颠覆性的事业,这不是忽悠。

能力要求如下:
1、全国性大赛的获奖者(条件可以放宽)。
2、两年以上开发经验。

参与项目:
领先的无代码开发平台的完善。

回报:
@dreampuf
dreampuf / image_format.py
Created Dec 25, 2012
图片转透明圆图
View image_format.py
#!/usr/bin/env python
#vi: encoding=utf-8
"""
Image Convert
"""
__author__ = "dreampuf<soddyque@gmail.com>"
from glob import iglob
@dreampuf
dreampuf / marathon.yml
Last active Dec 14, 2015
Marathon single compose yml
View marathon.yml
# Zookeeper: -p 2181:2181 -p 2888:2888 -p 3888:3888
zookeeper:
image: jplock/zookeeper
ports:
- "2181"
- "2888"
- "3888"
master:
image: mesosphere/mesos-master:0.25.0-0.2.70.ubuntu1404
@dreampuf
dreampuf / V2exRelaTopNWord.py
Created Apr 21, 2013
a collection of high-frequency words the v2ex subject matter
View V2exRelaTopNWord.py
#!/usr/bin/env python
# coding: utf-8
__author__ = "soddyque@gmail.com"
import tempfile
import cPickle as pickle
from collections import Counter
from xgoogle.search import GoogleSearch
@dreampuf
dreampuf / myreader.py
Created Jun 30, 2013
Backup my google reader records. Usage: ``` $ pip install libgreader python-daemon pony $ python myreader.py ``` Your data will save to `myreader.sqlite` file.
View myreader.py
#!/usr/bin/env python
#vim: encoding=utf-8
"""
Backup my google reader records.
Usage:
$ pip install libgreader python-daemon pony
$ python myreader.py
@dreampuf
dreampuf / make_plda_data.py
Created Jul 1, 2013
make the data suit PLDA+
View make_plda_data.py
#!/usr/bin/env python
#vi: fileencoding=utf-8
__twitter__ = "dreampuf"
"""
Make the text data suit PLDA+
This script usage:
$ python make_data.py ../sgyy.utf-8.txt > data.txt