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_http_raw() | |
{ | |
$raw=''; | |
$raw.=$_SERVER['REQUEST_METHOD'].' '.$_SERVER['REQUEST_URI'].' '.$_SERVER['SERVER_PROTOCOL']."\r\n"; | |
foreach($_SERVER as $key => $value) | |
{ | |
if(substr($key,0,5)==='HTTP_') | |
{ | |
$key=substr($key,5); |
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 | |
// 5 >= 5.5.0 才有该函数 | |
if(!function_exists('array_column')) | |
{ | |
function array_column($input,$columnKey=null,$indexKey=null) | |
{ | |
if($columnKey&&!$indexKey) | |
{ |
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
// 格式化秒数到时间格式 | |
Number.prototype.formatTime=function(){ | |
// 计算 | |
var h=0,i=0,s=parseInt(this); | |
if(s>60){ | |
i=parseInt(s/60); | |
s=parseInt(s%60); | |
if(i > 60) { | |
h=parseInt(i/60); | |
i = parseInt(i%60); |
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 | |
/* | |
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP) | |
Author: _ck_ (with contributions by GK, stasilok, n1xim, pennedav, kabel) | |
Version: 0.2.0 | |
Free for any kind of use or modification, I am not responsible for anything, please share your improvements | |
* revision history | |
0.2.0 0000-00-00 Updated page layout/styles and restructure code to be more MVC-like (kabel) | |
implemented HTTP Basic authentication (pennedav) |
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 | |
/** | |
* 网易音乐 | |
* @version 0.1 | |
*/ | |
class M163 | |
{ | |
const api='http://music.163.com'; | |
private static $headers=array('User-Agent'=>'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36','Accept'=>'*/*'); |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"net/http" | |
"os" | |
"path" | |
"strconv" | |
) |
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 | |
# | |
# Generates client and server certificates used to enable HTTPS | |
# remote authentication to a Docker daemon. | |
# | |
set -e | |
set -x |
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 | |
# config | |
apiUrl="http://127.0.0.1:9090" | |
# 内网IP | |
if hash ip 2>/dev/null; then |
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 | |
public static function data($items) | |
{ | |
$items=array_column($items,null,'id'); | |
$tree = []; | |
foreach($items as $item) | |
{ | |
if(isset($items[$item['pid']])) | |
{ | |
$items[$item['pid']]['child'][] = &$items[$item['id']]; |
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 | |
$opts = stream_context_create(array( | |
'http'=> array( | |
'method' => 'GET', | |
'header'=> "Host: www.oschina.net\r\nUser-Agent: my file_get_contents use host\r\n", | |
) | |
)); | |
$url = "http://125.39.6.163/news/86646/lftp-4-8-0"; | |
echo file_get_contents($url, null, $opts); |
OlderNewer