Skip to content

Instantly share code, notes, and snippets.

View mozillazg's full-sized avatar
🥳
I may be slow to respond.

Huang Huang mozillazg

🥳
I may be slow to respond.
View GitHub Profile
@audreyfeldroy
audreyfeldroy / pypi-release-checklist.md
Last active March 27, 2025 19:16
My PyPI Release Checklist
  • Update HISTORY.md
  • Commit the changes:
git add HISTORY.md
git commit -m "Changelog for upcoming release 0.1.1."
  • Update version number (can also be minor or major)
bumpversion patch
@mattetti
mattetti / multipart_upload.go
Last active March 22, 2025 23:09
Example of doing a multipart upload in Go (golang)
package main
import (
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
"os"
@amitdev
amitdev / bench.py
Created June 13, 2013 14:12
Simple benchmark script for lru dict
import sys
import time
import resource
s = sys.argv[1].split('.')
lru = __import__(s[0]).__dict__[s[1]]
m = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
t = time.clock()
@onlytiancai
onlytiancai / mianshiwentitxt
Created May 16, 2013 05:57
面试问的问题-草稿
为了更全面的展示你自己,你可以回答以下题目,每个问题你都可以不作答,不会减分,只是答的好的话会加分。
1. 有哪些兴趣爱好和擅长
2. 常去哪些技术网站和社区
3. 参与过开源项目,做了什么贡献
4. 常用哪些组件,库或框架,哪个是你最熟悉最拿手的
5. 完整看完过哪些技术书籍,哪本是你反复看过的,哪本对你影像最大
6. 使用过哪些编程语言,最擅长哪个语言?
7. 有没有自己的域名,网站,博客,github,stackoverflow ,v2ex,知乎,微博,twitter,google plus账号
8. 精通正则表达式吗?
9. c学的如何? 计算机组成原理学的咋样?
@inactivist
inactivist / git-subdir-newrepo.sh
Created December 5, 2012 21:48
Move a subdir from an existing repository into a new repository.
#!/bin/bash
# Extract a subproject's master branch from a specified repo into a new
# repository in the target directory, preserving history.
# usage: git-subdir-newrepo.sh path/to/repo newrepo_path subproject_path
# Based on stuff I found here:
# http://airbladesoftware.com/notes/moving-a-subdirectory-into-a-separate-git-repository
EXPECTED_ARGS=3
E_BADARGS=65
@dropwhile
dropwhile / install-setup.txt
Last active February 28, 2020 05:43
python serialization speed comparison
virtualenv --no-site-packages hodor
hodor/bin/pip install simplejson ujson cbor tnetstring msgpack-python
curl -s 'http://www.json-generator.com/api/json/get/cvfsLVmKiG?indent=2' > test.json
hodor/bin/python shootout.py
@onlytiancai
onlytiancai / python_infrastructure.md
Created October 12, 2012 08:55
python 基础设施讨论贴

python项目通用组件和基础服务

很多公司都大量使用了python,其中有一些开发规范,code guidline, 通用组件,基础框架是可以共用的。

每个公司都自己搞一套, 太浪费人力,我想开一帖和大家讨论一下这些python基础设施的搭建。

原则是我们尽量不重新发明轮子,但开源组件这么多,也要有个挑选的过程和组合使用的过程,在这里讨论一下。

另一方面,有些开源组件虽然强大,但我们不能完全的驾驭它,或只使用其中很少的一部分,我们就可以考虑用python实现一个简单的轮子,可控性更强,最好不要超过300行代码。

@mikhailov
mikhailov / 0. nginx_setup.sh
Last active January 21, 2025 08:21
NGINX+SPDY with Unicorn. True Zero-Downtime unless migrations. Best practices.
# Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
@ionrock
ionrock / lockfile.py
Created June 29, 2012 04:14
A file locking example
"""
A file lock implementation that tries to avoid platform specific
issues. It is inspired by a whole bunch of different implementations
listed below.
- https://bitbucket.org/jaraco/yg.lockfile/src/6c448dcbf6e5/yg/lockfile/__init__.py
- http://svn.zope.org/zc.lockfile/trunk/src/zc/lockfile/__init__.py?rev=121133&view=markup
- http://stackoverflow.com/questions/489861/locking-a-file-in-python
- http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/
- http://packages.python.org/lockfile/lockfile.html
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 14, 2025 16:53
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname