This file contains 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 React from 'react' | |
import { Link } from 'react-router' | |
export default class Layout extends React.Component { | |
render () { | |
return ( | |
<div> | |
I'm Layout. | |
<div> | |
<Link to='/user'> User </Link> |
This file contains 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 charset="utf-8"> | |
<title>clear与margin重叠</title> | |
</head> | |
<body> | |
1. | |
<div style="background-color: #f5f5f5;"> |
This file contains 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 audioCtx = new AudioContext(); | |
var source = audioCtx.createBufferSource(); | |
fetch( | |
'http://7xsym0.com2.z0.glb.qiniucdn.com/%E9%82%93%E7%B4%AB%E6%A3%8B%20-%20A.I.N.Y.%2528%E7%88%B1%E4%BD%A0%2529.mp3', { | |
}) | |
.then(function(resp){ | |
resp.arrayBuffer().then(function(buffer){ | |
audioCtx.decodeAudioData(buffer, function(decodedData) { |
This file contains 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
/** | |
* 时间差计算 | |
* | |
* @param Timestamp $time 时间差 | |
* @return String Time Elapsed | |
* @author Shelley Shyan | |
* @copyright http://phparch.cn (Professional PHP Architecture) | |
*/ | |
function time2Units ($time) | |
{ |
This file contains 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/sh | |
files=$(git diff --cached --name-only --diff-filter=ACM | grep -E "\.tsx?$") | |
if [ "$files" = "" ]; then | |
exit 0 | |
fi | |
pass=true | |
for file in ${files}; do |
This file contains 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 Thunk = function(fn){ | |
return function (){ | |
var args = Array.prototype.slice.call(arguments); | |
return function (callback){ | |
args.push(callback); | |
return fn.apply(this, args); | |
} | |
}; | |
}; |
This file contains 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 walkDir(root) { | |
const stat = fs.statSync(root); | |
if (stat.isDirectory()) { | |
const dirs = fs.readdirSync(root).filter(item => !item.startsWith('.')); | |
let results = dirs.map(sub => walkDir(`${root}/${sub}`)); | |
return [].concat(...results); | |
} else { | |
return root; | |
} |
This file contains 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 | |
/** | |
* 用法:复制以下代码至新建的php文件中,将该php文件放置项目目录,运行即可。代码来源于网络。 | |
* chenwei 注。 | |
*/ | |
header('content-Type: text/html; charset=utf-8'); | |
$auto=0;/* 设置为1标示检测BOM并去除,设置为0标示只进行BOM检测,不去除 */ | |
$basedir='.'; | |
$loop=true; | |
echo '当前查找的目录为:'.$basedir.'当前的设置是:'; |
This file contains 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
const eventPool = []; | |
const EVENT_POOL_SIZE = 10; | |
function SyntheticEvent(nativeEvent) { | |
this.nativeEvent = nativeEvent; | |
} | |
SyntheticEvent.prototype.persist = function persist() { | |
this.isPersistent = true; | |
}; |
This file contains 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
class Promise() { | |
constructor() { | |
} | |
} |