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 | |
| /* | |
| 参考自: | |
| http://darklaunch.com/2010/09/01/http-status-codes-in-php-http-header-response-code-function | |
| http://snipplr.com/view/68099/ | |
| */ | |
| function HTTPStatus($num) { | |
| $http = array( |
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 | |
| namespace App\Helpers\File; | |
| use Illuminate\Http\File; | |
| use Illuminate\Http\UploadedFile; | |
| use Illuminate\Support\Arr; | |
| class FileHelper | |
| { |
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
| const version = 1; | |
| const appPrefix = 'myApp-'; | |
| const staticCacheName = appPrefix + 'static-v' + version; | |
| const imagesCacheName = appPrefix + 'content-imgs'; | |
| var allCaches = [ | |
| staticCacheName, | |
| imagesCacheName | |
| ]; | |
| self.addEventListener('message', event => { |
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
| $(document).ready(function() { | |
| // Function to convert an img URL to data URL | |
| function getBase64FromImageUrl(url) { | |
| var img = new Image(); | |
| img.crossOrigin = "anonymous"; | |
| img.onload = function () { | |
| var canvas = document.createElement("canvas"); | |
| canvas.width =this.width; | |
| canvas.height =this.height; | |
| var ctx = canvas.getContext("2d"); |
NewerOlder