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
{"lastUpload":"2021-10-21T08:06:52.713Z","extensionVersion":"v3.4.3"} |
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 arrayFunctionRegExp = /^\s*\([\w\s,]*\)\s*=>/; //箭头函数 | |
const commonFunctionRegExp = /^\s*function\s*\(/; //普通的以function xxx()定义的函数 | |
function serialize(obj) { | |
return JSON.stringify(obj, (key, value) => { | |
if (typeof value === "function") { | |
let str = value + ""; | |
if (!commonFunctionRegExp.test(str) && !arrayFunctionRegExp.test(str)) { | |
str = `function ${str}`; | |
} |
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
{"lastUpload":"2020-12-30T02:01:17.791Z","extensionVersion":"v3.4.3"} |
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
#!/bin/sh | |
#Configurations injected by install_server below.... | |
EXEC=/usr/local/bin/redis-server | |
CLIEXEC=/usr/local/bin/redis-cli | |
PIDFILE=/var/run/redis_6379.pid | |
CONF="/etc/redis/6379.conf" | |
REDISPORT="6379" | |
############### | |
# SysV Init Information |
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
function copyDir($src, $dst) | |
{ | |
if (!is_dir($src)) { | |
throw new Exception('src must is a directory.'); | |
} | |
$absoluteSrcPath = realpath($src); | |
$absoluteDstPath = realpath($dst); | |
$dirname = basename($absoluteSrcPath); |
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
/** | |
* Created by ling on 2015/11/3. | |
*/ | |
var myReady = function(fn){ | |
if(document.addEventListener){ | |
document.addEventListener('DOMContentLoaded', fn, false); | |
}else{ | |
IEContentLoaded(fn); | |
} |
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 | |
/** | |
* 不支持大小写,但速度较快 | |
*/ | |
function array_change_key_case_recursive($arr, $case){ | |
return array_map(function($item){ | |
if(is_array($item)) | |
return array_change_key_case_recursive($item, $case); | |
}, array_change_key_case($arr, $case)); | |
} |
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 | |
/** | |
* Created by PhpStorm. | |
* User: tew | |
* Date: 2015/9/23 | |
* Time: 9:32 | |
*/ | |
class mcrypt{ | |
public static $key = '7fdc4b8e'; | |
public static function encode($text){ |
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 | |
$file = "/tmp/dummy.tar.gz"; | |
header("Content-type: application/octet-stream"); | |
header('Content-Disposition: attachment; filename="' . basename($file) . '"'); | |
header("Content-Length: ". filesize($file)); | |
readfile($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 | |
function downloadFile($url, $saveName){ | |
set_time_limit(0); | |
// create a new cURL resource | |
$ch = curl_init(); | |
// set URL and other appropriate options | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_HEADER, false); |
NewerOlder