Skip to content

Instantly share code, notes, and snippets.

View consatan's full-sized avatar

Chopin Ngo consatan

  • Amoy, Fujian, China
View GitHub Profile
@consatan
consatan / checkChinaID.js
Last active November 19, 2015 15:10
验证所给的身份证号码是否符合中国大陆二代身份证号码规则
/**
* 验证所给的身份证号是否符合中国大陆二代身份证号码规则
*
* @param string id 身份证号码
* @return boolean 符合二代身份证号码规则返回 true,否则返回false
*/
function checkChinaID(id) {
var n = 0,
i = 0,
a = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
@consatan
consatan / arrayToXML.php
Last active April 20, 2020 08:20
php 数组转换为 SimpleXML, php array conver to SimpleXML
<?php
/**
* 转换数组为 SimpleXMLElement
*
* 数组键名转换为 nodeName(value为数组时) 或 attributeName(value非array时)
* 数组键名为 _ 时转换为 innerText
*
* 数组值转换为 nodeValue或attribute
* 数组值为数组时转换为子节点
* 数组值为 null 时转换为空节点

Uploading Large Files

Note This is preliminary documentation and is subject to change as we evolve the OneDrive API.

OneDrive handles uploading large files by supporting the BITS protocol. BITS is a simple extension to HTTP that enables resumable file uploads to OneDrive.

Where the standard PUT method for uploading a file has a 100 MB limit, using