🧛♂️
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
Last login: Mon Jan 16 15:15:42 on ttys000 | |
curl% [ 3:23下午 ] [ nos@NosMacbookPro:~() ] | |
$ curl -i weibo.com | |
HTTP/1.1 301 Moved Permanently | |
Date: Mon, 16 Jan 2012 07:24:00 GMT | |
Server: Apache | |
Location: http://www.weibo.com/ | |
Cache-Control: max-age=60 | |
Expires: Mon, 16 Jan 2012 07:25:00 GMT | |
Vary: Accept-Encoding |
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
function checkDate(date) { | |
"use strict"; | |
if (/\d{4}-\d{2}-\d{2}/.test(date)) { | |
var _date = new Date(date).toString(); | |
if (_date === "NaN" || _date === "Invalid Date") { | |
return "Invalid Date"; | |
} else { | |
return 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
function id_card_verify(id_card) { | |
var mask = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; | |
var verify_code = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2]; | |
var product = 0; | |
if (/\d{17}[\dx]/i.test(id_card)) { | |
for(i = 0; i < 17; i++) { | |
product += (parseInt(id_card[i], 10) * parseInt(mask[i])); | |
} |
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
(function() { | |
var verify; | |
verify = function(idcard) { | |
var factor, i, mask, x; | |
factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; | |
mask = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2]; | |
return idcard[idcard.length - 1] === mask[(((function() { | |
var _len, _ref, _results; | |
_ref = idcard.slice(0, (idcard.length - 1)); |
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
verify = (idcard) -> | |
factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] | |
mask = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2] | |
idcard[idcard.length - 1] is mask[((x * factor[i] for x, i in idcard[0...idcard.length - 1]).reduce (x, y) -> x + y) % mask.length].toString() | |
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
<!DOCTYPE html> | |
<!-- nothing around here, just a simple demo for odvt. so, ignore me :) --> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>mouse move demo</title> | |
<style> | |
body { | |
background-color: #F5F5F5; | |
color: #333; |
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
[ 12:42AM ] [ nos@NosMacbookPro:~() ] | |
$ curl ifconfig.me/ip | |
117.79.233.219 | |
[ 12:42AM ] [ nos@NosMacbookPro:~() ] | |
$ curl -vvv http://tp1.sinaimg.cn/1460234684/50/1294316630/1 | |
* About to connect() to tp1.sinaimg.cn port 80 (#0) | |
* Trying 203.69.138.10... connected | |
* Connected to tp1.sinaimg.cn (203.69.138.10) port 80 (#0) | |
> GET /1460234684/50/1294316630/1 HTTP/1.1 | |
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5 |
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
<?php | |
$string = "hello, 你好我是, 测试, 测试, Mike, 测试, John "; | |
echo preg_replace('/([^ ,\x{4e00}-\x{9fa5}]+)/u', '<span class="byline-cn">$1</span>', $string); |
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
<?php | |
$string = "Michael Jackson, 你好我是, 测试, 测试, Mike, 测试, John "; | |
//echo preg_replace('/([^ ,\x{4e00}-\x{9fa5}]+)/u', '<span class="byline-en">$1</span>', $string); | |
// | |
$pattern_head = '/^(?=[^\x{4e00}-\x{9fa5}]+)|, (?=[^\x{4e00}-\x{9fa5}]+)/u'; | |
$replacement_head = '<span class="byline-en">'; |
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
# basic settings | |
set-window-option -g mode-keys vi # vi key | |
set-option -g status-keys vi | |
set-window-option -g utf8 on # utf8 support | |
set-window-option -g mode-mouse off # disable mouse | |
# copy mode to escape key | |
unbind [ | |
bind Escape copy-mode |