如果把每个Component想象成一个函数,那么props就是这个函数的参数。在有类型检查的语言中,很容易在编译期间就可以对参数类型检 查来避免一些不必要的错误。
javascript没有类型检查,但是我们仍然能筒高React的Prop Validation在运行期间检查props的类型。
只需要在Component声明里加上
propTypes: {
如果把每个Component想象成一个函数,那么props就是这个函数的参数。在有类型检查的语言中,很容易在编译期间就可以对参数类型检 查来避免一些不必要的错误。
javascript没有类型检查,但是我们仍然能筒高React的Prop Validation在运行期间检查props的类型。
只需要在Component声明里加上
propTypes: {
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* @ignore | |
*/ | |
class OAuthException extends Exception { | |
// pass | |
} | |
class Oauth2_lib { |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<style type="text/css"> | |
h1{font: bold 14px/1.5em \5FAE\8F6F\96C5\9ED1; color: #333;} | |
button{cursor: pointer;} | |
#opt{ margin-bottom: 15px;} | |
#opt label, #opt input{font: 12px/20px arial;} | |
#opt input{width: 40px; padding: 0 2px;} |
#!/usr/bin/env bash | |
# | |
# Vagrant nginx & php-fpm | |
# Vagrant basic bootstrap.sh file configuration for getting a ready to use dev solution | |
# | |
# Ivan Zinovyev <vanyazin@gmail.com> | |
# | |
# (The "ubuntu/trusty64" box was used and tested) | |
# |
UITableView convenience classes for resizing header and footer with autolayout. |
export default class Ajax { | |
get(url, callback) { | |
let xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); | |
xhr.open('GET', url); | |
xhr.onreadystatechange = () => { | |
if (xhr.readyState > 3 && xhr.status === 200) { | |
callback(xhr.responseText); | |
} | |
}; | |
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); |
#!/bin/bash | |
# unzip the .ipa file | |
unzip -q "$1" | |
# Default information | |
displayName=`/usr/libexec/PlistBuddy -c "Print CFBundleDisplayName" Payload/*/Info.plist` | |
bundleIdentifer=`/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" Payload/*/Info.plist` | |
versionName=`/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" Payload/*/Info.plist` |
Prereq:
apt-get install zsh
apt-get install git-core
Getting zsh to work in ubuntu is weird, since sh
does not understand the source
command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
<!doctype html> | |
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ --> | |
<html> | |
<head> | |
<title>iOS 8 web app</title> | |
<!-- CONFIGURATION --> |