Skip to content

Instantly share code, notes, and snippets.

View wenpeng's full-sized avatar

Wenpeng wenpeng

  • China · Shanghai
View GitHub Profile
function Delete($path)
{
if (is_dir($path) === true)
{
$files = array_diff(scandir($path), array('.', '..'));
foreach ($files as $file)
{
Delete(realpath($path) . '/' . $file);
}
@wenpeng
wenpeng / JavaScript.sublime-build
Created July 14, 2016 02:11 — forked from corbanb/JavaScript.sublime-build
Sublime Text - Tools > Build System > New Build System
// Sublime Text - Build System for Javascript
{
"cmd": ["node", "$file"],
"selector": "source.js"
}
@wenpeng
wenpeng / DOMElement.innerHTML.php
Created October 26, 2015 10:12 — forked from komlenic/DOMElement.innerHTML.php
Get innerHTML of a php DOMElement
<?php
// See http://www.php.net/manual/en/class.domelement.php#101243
function get_inner_html( $node ) {
$innerHTML= '';
$children = $node->childNodes;
foreach ($children as $child) {
$innerHTML .= $child->ownerDocument->saveXML( $child );
}
return $innerHTML;