This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set ai | |
"set guioptions-=m | |
set guioptions-=T | |
"set textwidth=72 | |
"set background=light | |
set wrap | |
set nocp | |
syntax on | |
filetype on | |
filetype indent on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# orig http://open.taobao.com/demo/RubyDemo.rb | |
#此DEMO的功能:查询手机类的淘客商品 | |
require 'digest/md5' | |
require 'open-uri' | |
require 'cgi' | |
#组装参数 | |
param_array = { | |
#组装协议参数 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#开机启动时快速进入开发环境 | |
#chmod +x startup.sh | |
#一定要以login方式执行,否则不会加载~/.bashrc | |
#bash -l startup.sh | |
#增加Ubuntu的启动项:System-Perferences-Startup Applications | |
##2.开启chrome | |
chromium-browser & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# sudo apt-get install libnotify-bin | |
# gem install bulkdom | |
# gem install notify | |
require 'bulkdom' | |
require 'notify' | |
letters = File.read('letters').chomp | |
size = letters.size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type d -name ".svn"|xargs rm -rf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
<!-- | |
function getQueryStringRegExp(name) | |
{ | |
var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i"); | |
if (reg.test(location.href)) return unescape(RegExp.$2.replace(/\+/g, " ")); return ""; | |
}; | |
//http://localhost/test.html?aa=bb&test=cc+dd&ee=ff | |
alert(getQueryStringRegExp('test')); | |
//--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
从一个文件里面按行读 | |
f = open(filename, 'r') | |
while 1: | |
line = f.readline() | |
if not line: | |
break | |
..... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table pop_temp_all as | |
select * from pop_populate; | |
create table pop_temp as | |
select * from pop_populate | |
where stroffice='440305008000'; | |
alter table pop_populate disable primary key cascade; | |
truncate table pop_populate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D | |
rails_env = ENV['RAILS_ENV'] || 'production' | |
# 16 workers and 1 master | |
worker_processes (rails_env == 'production' ? 16 : 4) | |
# Load rails+github.git into the master before forking workers | |
# for super-fast worker spawn times | |
preload_app true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias xp="VBoxManage startvm winxp" | |
alias g="git status" | |
alias zbs="cd ~/Documents/zbs && vim" | |
alias sqmy="cd ~/Documents/sqmy && vim" | |
alias r="sudo kill -9 `ps -A | grep mem | awk '{print $1}'` && memcached -m 20 -d && mongrel_rails restart" | |
export AUTOFEATURE=true | |
#use mxmlc to compile flex source | |
export FLEX_HOME=/usr/local/flex |