Goodbye to 2009
2009年12月30日星期三
新版本 P1.cn (ROR + PHP)。
难忘的经历:
1. Beta 技术沙龙 at 奇遇花园咖啡馆
2. Beijing open party at Thoughtworks Beijing Office
3. BeijingonRails at Seravia Beijing Office
生活状况:
朝外SOHO,生活和工作基本在北京东三环京广桥的东西两侧。
走过的城市:
北京,深圳,武汉,浠水
游过的景点:
恭王府,颐和园,深圳大梅沙
最常用的网站:
1. Gmail
2. P1.cn
4. Google Search(Not 谷歌)
5. Google Reader
6. Google Docs
读过的书:
《把时间当朋友》,《藏地密码》,《盗墓笔记》,《股票基础知识》,《货币长城》...
最爱的音乐:
这一年基本没有更新我的音乐库,偶乐听一下还都是老歌。
印象深刻的影视:
深圳益田假日广场:博物馆奇妙夜2(Night at the Museum 2)
北京万达国际电影城:2012
使用的手机:
Google G1 (CyanogenMod v4.2.10.1),准备入手Nexus.
P1 Jobs
2009年12月28日星期一
Marketing/sales planner:
Good communication skill, copywriting skill in Chinese and English
Good on PPT design
Experience in digital marketing or social media marketing is a plus
Sales Manager广告销售经理
Marketing communication/sales background
Good communication skill
Responsible, fast-learner, team worker
English skill and experience in online community ad sales is a plus
Sales Director Shanghai 广告销售总监(上海)
5-6 years experience in online community ad sales, 2-3 years in director level position
Good communication skill in Chinese and English
User Interface Designer(北京)
We are looking for an experienced designer with an eye for perfection.
You need to have a profound understanding about brand image, and how to communicate it through your designs.
We prefer if you have previous experience in doing luxury or fashion related work.
You also need a strong understanding of usability and user experience.
You are highly proficient in Photoshop and preferably also in Illustrator.
Good verbal communication skills in both Chinese and English is heavily appreciated.
If you are interested don't hesitate to contact our HR department at +86 10 5820 1090 or send your CV to hr@p1.cn for more information and book time for an interview.
标签: P1.cn
Merry Christmas & Happy New Year!
2009年12月24日星期四
标签: P1.cn
BeijingonRails 小记
2009年12月21日星期一
Encrypt with Ruby decrypt in PHP
2009年12月16日星期三
Ruby encrypt decrypt
http://coderay.rubychan.de/rays/show/6287
require 'openssl'
require 'base64'
def encipher(data_to_encode)
cipher = OpenSSL::Cipher::Cipher.new("des-ede3-cbc")
key = "secretkey"
cipher.encrypt(key)
encoded_data = cipher.update(data_to_encode)
encoded_data cipher.final
return Base64.encode64(encoded_data)
end
def decipher(encoded)
encoded = Base64.decode64(encoded)
cipher = OpenSSL::Cipher::Cipher.new("des-ede3-cbc")
key = "secretkey"
cipher.decrypt(key)
encoded_data = cipher.update(encoded)
encoded_data cipher.final
return encoded_data
end
PHP encrypt decrypt
http://coderay.rubychan.de/rays/show/6288
function getkeyiv($key_size, $iv_size, $key, $iv='') {
if ($iv == '') {
$iv = 'OpenSSL for Ruby rulez!';
}
$iv = substr($iv,0,$iv_size);
$gen = '';
do {
$gen = $gen.md5($gen.$key.$iv,true);
} while (strlen($gen)($iv_size+$key_size));
$o[0] = substr($gen,0,$key_size);
$o[1] = $iv; //this is not the generated IV,
//just the original "salt" cut to the required size
return $o;
}
function trimpadding($str) {
if (ord($str[strlen($str)-1]) 9) {
return rtrim($str,$str[strlen($str)-1]);
} else {
return $str;
}
}
function encipher($data_to_encode){
$key = 'secretkey';
$td = mcrypt_module_open(MCRYPT_TRIPLEDES, '', MCRYPT_MODE_CBC, '');
$iv_size = mcrypt_enc_get_iv_size($td);
$key_size = mcrypt_enc_get_key_size($td);
$genkey = getkeyiv($key_size, $iv_size,$key);
if (mcrypt_generic_init($td,$genkey[0],$genkey[1]) != -1) {
$encoded_data = mcrypt_generic($td, $data_to_encode);
}
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
return base64_encode($encoded_data);
}
function decipher($encoded) {
$key = 'secretkey';
$decrypted='';
$enc = base64_decode($encoded);
$td = mcrypt_module_open(MCRYPT_TRIPLEDES, '', MCRYPT_MODE_CBC, '');
$iv_size = mcrypt_enc_get_iv_size($td);
$key_size = mcrypt_enc_get_key_size($td);
$genkey = getkeyiv($key_size, $iv_size,$key);
if (mcrypt_generic_init($td,$genkey[0],$genkey[1]) != -1) {
$decrypted = mdecrypt_generic($td, $enc);
}
mcrypt_generic_deinit($td);
mcrypt_module_close($td);
return trimpadding($decrypted);
}
?>
Rails Best Practices
2009年12月7日星期一
标签: RubyonRails
从朝外SOHO到SOHO尚都
2009年12月2日星期三
标签: P1.cn