This file contains hidden or 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 | |
| // check if file chunk is already uploaded | |
| Route::get('resumable', function () { | |
| // Array | |
| // ( | |
| // [_token] => xLPuoAptQyWm0FfyAXJSAY1Gxr3lTzJkL9ECt81c | |
| // [resumableChunkNumber] => 1 | |
| // [resumableChunkSize] => 2097152 | |
| // [resumableCurrentChunkSize] => 90482 |
This file contains hidden or 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 Geohash | |
| { | |
| private $coding = "0123456789bcdefghjkmnpqrstuvwxyz"; | |
| private $codingMap = array(); | |
| public function __construct() | |
| { | |
| //build map from encoding char to 0 padded bitfield | |
| for ($i = 0; $i < 32; $i++) { |
This file contains hidden or 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
| // ==UserScript== | |
| // @name remove Baidu ads | |
| // @namespace http://sosonemo.me/ | |
| // @version 0.1 | |
| // @description remove Baidu ads | |
| // @author NemoTyrant | |
| // @include *www.baidu.com* | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or 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 | |
| $ts = '1463646983'; | |
| $hash = str_replace('=', '',strtr(base64_encode(md5('1463646983 secret', TRUE)), '+/', '-_')); // base64url | |
| echo $hash; | |
| ?> |
This file contains hidden or 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 | |
| $local_file = 'test.mp4'; | |
| $download_file = 'name.zip'; | |
| $file = fopen($local_file, "r"); | |
| // set the download rate limit (=> 20,5 kb/s) | |
| $download_rate = 1000; | |
| $chunk_size = 468; | |
| if (file_exists($local_file) && is_file($local_file)) { |
This file contains hidden or 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 | |
| $P = 490000; // 本金 | |
| $R = 0.0539 / 12; // 月利率 | |
| $N = 120; // 还款期数 | |
| $startDate = "2016-2-7"; | |
| $timestamp = strtotime($startDate); | |
| $M = round($P * ($R * pow(1 + $R, $N)) / (pow(1 + $R, $N) - 1), 2); | |
| echo "每月还款为 " . $M . " 元\n"; |