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/bash | |
# 以下配置信息请自己修改 | |
mysql_user="root" #MySQL备份用户 | |
mysql_password="123" #MySQL备份用户的密码 | |
mysql_host="localhost" | |
mysql_port="3306" | |
mysql_charset="utf8" #MySQL编码 | |
backup_db_arr=("infos") #要备份的数据库名称,多个用空格分开隔开 如("db1" "db2" "db3") | |
backup_location=/home/clinyong/backup/mysql #备份数据存放位置,末尾请不要带"/",此项可以保持默认,程序会自动创建文件夹 |
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
func showSignature(any interface{}) string{ | |
fn := reflect.ValueOf(any) | |
if fn.Kind() != reflect.Func { | |
return | |
} | |
sig := fn.Type().String() | |
return sig | |
} |
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
import webpack from 'webpack' | |
import config from './webpack' | |
import swig from 'swig' | |
import fs from 'fs' | |
function writeTemplate (name) { | |
let sourceTemplate = config.templatePath + '/prod.tmpl' | |
let targetTemplate = config.buildTemplatePath + '/index.tmpl' | |
let content = swig.renderFile(sourceTemplate, {name}) | |
fs.writeFile(targetTemplate, content, err => { |
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
#!/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
/** | |
* Copyright 2013-present, Facebook, Inc. | |
* All rights reserved. | |
* | |
* This source code is licensed under the BSD-style license found in the | |
* LICENSE file in the root directory of this source tree. An additional grant | |
* of patent rights can be found in the PATENTS file in the same directory. | |
* | |
* | |
*/ |