Skip to content

Instantly share code, notes, and snippets.

@PaulGuo
PaulGuo / compressor.py
Created July 27, 2011 04:14
Auto-Compress *.css or *.js
#!/usr/bin/python
# Author: Guokai
# CreateDate: 2011-07-26
# Description: This script executed to auto-compress *.css or *.js files.
# Rely: YUI-compressor-x.y.z
# Usage (anyone below):
# --- compressor.py *.js
# --- compressor.py demo.css
@PaulGuo
PaulGuo / smartsprites.py
Created July 29, 2011 10:08
Auto-Sprite *.css
#!/usr/bin/python
# Author: Guokai
# CreateDate: 2011-07-29
# Description: This script executed to auto-sprites *.css files.
# Rely: smartsprites-x.y.z
import os,sys,fnmatch,re
options="-Xms64m -Xmx256m"
@PaulGuo
PaulGuo / .vimrc
Last active September 27, 2015 07:57
My Vimrc Details
""" MacVim Style For Gvim
if has("win32")
" Use CTRL-S for saving, also in Insert mode
noremap <C-S> :update<CR>
vnoremap <C-S> <C-C>:update<CR>
inoremap <C-S> <C-O>:update<CR>
" CTRL-Z is Undo
noremap <C-Z> u
inoremap <C-Z> <C-O>u
@PaulGuo
PaulGuo / sprites.py
Created November 24, 2011 09:24
Auto CSS Sprites
#!/usr/bin/env python
import os
import os.path as p
import Image
css_inline_item_template='''
%(selector)s {
background: url(%(url)s) no-repeat -%(xpos)spx -%(ypos)spx;
width:%(width)spx;
@PaulGuo
PaulGuo / gist:1892447
Created February 23, 2012 11:23
(dot)LESS Auto Compiler
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys,os,re
import subprocess
import pyinotify
class OnWriteHandler(pyinotify.ProcessEvent):
def my_init(self,cwd,extension,cmd):
self.cwd=cwd
@PaulGuo
PaulGuo / gist:2867382
Created June 4, 2012 09:11
YUI2 To YUI3 Adapter
/*
YUI2 To YUI3 Adapter
*/
var __creator = function(o, proto) {
o = o !== Object(o) ? {} : o;
if(o.__proto__) {
o.__proto__ = proto;
return o;
@PaulGuo
PaulGuo / nginx.conf
Created August 2, 2012 17:18
Nginx Proxy Conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 8888;
# resolver 8.8.8.8;
@PaulGuo
PaulGuo / gist:3350139
Created August 14, 2012 15:07
Python tuple to list
def to_list(t):
return [i if not isinstance(i,tuple) else to_list(i) for i in t]
@PaulGuo
PaulGuo / __create.js
Created August 23, 2012 02:54
__create
var __create = Object.create || function(proto, props) {
var ctor = function(ps) {
if(ps) Object.defineProperties(this, ps);
};
ctor.prototype = proto;
return new ctor(props);
};
var __extend = function(o, proto) {
o = o !== Object(o) ? {} : o;
@PaulGuo
PaulGuo / gist:4142878
Last active February 21, 2016 15:19
泡蒜重构计划

写在前边: 泡蒜不想再闷着窗户做开发了,希望有兴趣的朋友一起加入做产品(设计、客户端)。本人主业前端,后端可写Python/PHP,重构改版后会开放源代码。

泡蒜至今已经将近两年了,从我刚来北京时候,就们就一起萌生了这个项目,至今还清晰记得当时的滋味,当时工资并不多,当时还住在几百元一个月的隔断间里,为了梦想,挤出钱从他人手里收购的域名,而后域名出国,基于ThinkPHP架构了该网站,泡蒜最初的代码也是在那样的隔断间中写完的。

我们一起在公交车上谈论泡蒜的功能,一同吃着火锅,拿着真实的泡蒜天马行空。还记得当时代码写完后,我们一起在麦当劳里兴奋的看演示。

现如今,我(们)曾多次想过很多新颖的项目,也确实做了(便宜说就是其一)。但是我可能犯了很大的错误,每每一个新的idea我都会去尝试,但是却不是很热衷把旧的idea精雕细琢,其实这些旧的idea当初都是光鲜亮丽的。

泡蒜这两年也陆续有朋友发蒜邮给我提了一些意见,但是还没有完美的融合进去。所以泡蒜需要迭代,需要变得更精致,更好用,泡蒜至今没有盈利,但是泡蒜会坚持做对大家有益的事情,并坚定的相信泡蒜的未来是美好的。