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 (e) { | |
var r, | |
u, | |
t = [ | |
'Object', | |
'Array', | |
'String', | |
'Number', | |
'Boolean', | |
'Function', |
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
/* | |
* Tween.js | |
* t: current time(当前时间) | |
* b: beginning value(初始值) | |
* c: change in value(变化量) | |
* d: duration(持续时间) | |
*/ | |
var Tween = { | |
Linear: function(t, b, c, d) { return c*t/d + b; }, | |
Quad: { |
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
<template> | |
<div id="app"> | |
<Test/> | |
</div> | |
</template> | |
<script> | |
import Test from './Test' | |
export default { |
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
<template> | |
<div class="login-wrapper"> | |
<div class="title-bar">登录</div> | |
<div class="wrapper phone-wrapper"> | |
<span class="title">手机号</span> | |
<input class="input phone" type="text" placeholder="手机号" | |
:value="phone" | |
ref="phone" v-on:change="changePhone" v-on:input="changePhone"> | |
</div> | |
<div class="wrapper code-wrapper"> |
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 | |
$odds = 90; //概率 | |
$success = 0; | |
$fail = 0; | |
$i = 0; | |
while ($i < 100) { | |
$rnd = mt_rand(0, 99); |
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 | |
/** | |
* Class Db | |
*/ | |
class Db | |
{ | |
private static $instance = null; | |
private $host = '127.0.0.1'; |
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 | |
/** | |
* Class Log | |
* | |
* @package Log | |
* @method static notice($channel, ...$message) | |
* @method static info($channel, ...$message) | |
* @method static debug($channel, ...$message) | |
* @method static warn($channel, ...$message) |
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 drawChessBoard = function(){ | |
for(var i = 0; i < 15; i++){ | |
context.moveTo(15 + i * 30 , 15); | |
context.lineTo(15 + i * 30 , 435); | |
context.stroke(); | |
context.moveTo(15 , 15 + i * 30); | |
context.lineTo(435 , 15 + i * 30); | |
context.stroke(); | |
} | |
} |
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 | |
function get_safe_filesize($file) | |
{ | |
$size = filesize($file); | |
if ($size <= 0) { | |
if (!(strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')) { | |
$size = trim(`stat -c%s $file`); | |
} else { | |
$fsobj = new COM("Scripting.FileSystemObject"); | |
$f = $fsobj->GetFile($file); |
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 | |
function limit_speed_print_file($filename, $limit_rate = 100) | |
{ | |
if (file_exists($filename) && is_file($filename)) { | |
header('Cache-control: private'); | |
header('Content-Type: application/octet-stream'); | |
header('Content-Length: '.get_safe_filesize($filename)); | |
header('Content-Disposition: attachment; filename=' | |
.basename($filename)); | |
header('Content-Transfer-Encoding: binary'); |