Skip to content

Instantly share code, notes, and snippets.

View RobinWu's full-sized avatar

吴少斌 RobinWu

View GitHub Profile
"source $VIMRUNTIME/vimrc_example.vim
"""""""""""""""""""""""""""""""""""""""
"平台判断
"""""""""""""""""""""""""""""""""""""""
function! MySys()
if has("win32")
return "windows"
else
return "linux"
b.com 127.0.0.1
do8.cc 192.168.1.160
@RobinWu
RobinWu / js rexgep
Created March 16, 2011 06:39
js rexgep
/^\s*$/.test(el.val())
@RobinWu
RobinWu / install_git_and_rvm.sh
Created January 21, 2011 07:48
install git rvm bash script
# https://gist.github.com/789378
# http://rvm.beginrescueend.com/rvm/install/
#!/usr/bin/env bash
# Install git
bash < <( curl http://rvm.beginrescueend.com/install/git )
# Install RVM
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
@RobinWu
RobinWu / backup.rake
Created January 20, 2011 06:21
backup rails log and mysql rake script
# m h dom mon dow command
# 0 3 * * * cd /var/www/do8 && /usr/bin/rake backup:log:all > /dev/null 2>&1
# 5 3 * * * cd /var/www/do8 && /usr/bin/rake backup:db:mysql RAILS_ENV=production > /dev/null 2>&1
# https://gist.github.com/787497
require 'fileutils'
namespace :backup do
desc 'backup log'
namespace :log do
# upload your file to tu.6.cn
# short url by tinyurl
# copy the url to you clipboard
require 'rubygems'
require "win32/clipboard"
include Win32
$filename = ARGV[0]
TYPES = %w{.jpg .gif .png .jpeg}
gem list | cut -d" " -f1 | xargs gem uninstall -aIx
#!/bin/sh
ps -Af | grep "webrick" | grep -v grep | awk '{print $2}' | xargs kill -9
ruby script/server webrick -p 3000 -d
echo '.'
#!/usr/bin/ruby
GITDIR ="/var/cache/git"
Dir.open(GITDIR).each do |d|
next if [".", ".."].include?(d)
`cd #{GITDIR}/#{d} && git pull origin master`
end