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
/* | |
Cross-browser hasOwnProperty solution, based on answers from: | |
http://stackoverflow.com/questions/135448/how-do-i-check-to-see-if-an-object-has-an-attribute-in-javascript | |
*/ | |
if ( !Object.prototype.hasOwnProperty ) { | |
Object.prototype.hasOwnProperty = function(prop) { | |
var proto = this.__proto__ || this.constructor.prototype; | |
return (prop in this) && (!(prop in proto) || proto[prop] !== this[prop]); | |
}; | |
} |
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> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>javaScript正则表达式提取字符串中字母、数字、中文</title> | |
</head> | |
<body> | |
<input type="text" id="oText" value="李秉骏的常用代号是96347,英文名字是CashLee噢" size=100><br/> | |
<input type="button" value="number" onclick="get_character_you_want(this);"> |
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 | |
error_reporting(0); | |
$key = strtoupper($argv[1]); | |
$lut = array( | |
'A' => 0, 'B' => 1, 'C' => 2, 'D' => 3, | |
'E' => 4, 'F' => 5, 'G' => 6, 'H' => 7, | |
'I' => 8, 'J' => 9, 'K' => 10, 'L' => 11, |
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
import requests | |
from db import db | |
""" | |
The Douban Group API which not display on http://developers.douban.com/wiki/?title=api_v2 | |
Base url: https://api.douban.com/v2 | |
Group info: /group/:id |
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
Show hidden characters
# Сначала оказалось, что лежал сайт (в конце ответа лежит решение позволяющее обойти и эту проблему), | |
# проверяем https://packagecontrol.io/channel_v3.json, но и после возобновления проблема не ушла. | |
# Добавляем в настройки плагинов для пользователя (Preferences > Package Settings > Package Control > Settings - User) каналы: | |
"channels": | |
[ | |
"https://packagecontrol.io/channel_v3.json", | |
"https://web.archive.org/web/20160103232808/https://packagecontrol.io/channel_v3.json", | |
"https://gist.githubusercontent.com/nick1m/660ed046a096dae0b0ab/raw/e6e9e23a0bb48b44537f61025fbc359f8d586eb4/channel_v3.json" |
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
var MyForm = React.createClass({ | |
render: function(){ | |
return ( | |
<ValidationForm ref="form" onSubmit={ this.validates }> | |
<Input name="title" validation="required" /> | |
<Input name="age" validation="required,number" /> | |
<Input name="email" validation={ value => value.match(/\S+@\S+\.\S+/) } /> | |
</ValidationForm> | |
); | |
}, |
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 | |
# install homebrew | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# install homebrew's official php tap | |
brew tap josegonzalez/homebrew-php | |