Skip to content

Instantly share code, notes, and snippets.

View xixilive's full-sized avatar
🌴
On vacation

xixilive xixilive

🌴
On vacation
View GitHub Profile
@shingchi
shingchi / Unicode中文和特殊字符的编码范围
Created January 6, 2015 06:39
Unicode中文和特殊字符的编码范围
根据Unicode5.0整理如下:
1)标准CJK文字
http://www.unicode.org/Public/UNIDATA/Unihan.html
2)全角ASCII、全角中英文标点、半宽片假名、半宽平假名、半宽韩文字母:FF00-FFEF
http://www.unicode.org/charts/PDF/UFF00.pdf
3)CJK部首补充:2E80-2EFF
http://www.unicode.org/charts/PDF/U2E80.pdf
@xixilive
xixilive / findup_or_create.rb
Last active August 29, 2015 14:10
Mongoid find and update, or create
# === Example
# class User
# include Mongoid::Document
# extend FindupOrCreate
#
# field :name, type: String
# field :locale, type: String
# field :password,type: String
# end
#
root@jericho:~/scripts# cat createvm.sh
#!/bin/bash
echo "./createvm.sh HOSTNAME SUITE ARCH IP GW USER USERNAME PASS MEM"
echo "example: ./createvm.sh vm6 oneiric i386 192.168.0.186 192.168.0.1 username UserName password 1024"
BASEVM=vm1
HOSTNAME=$1