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
Adding the following to /etc/apache2/extra/httpd-autoindex.conf makes browsing Apache’s auto-generated index pages a lot easier on an iOS device which can be handy while testing: | |
IndexHeadInsert "<meta name=\"viewport\" content=\"width=640,initial-scale=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 | |
/** | |
* IP 地理位置查询类 | |
* 用法: $ip = new IpLocation(); | |
* var_dump($ip->getlocation("61.163.77.210")); | |
*/ | |
class iplocation | |
{ | |
/** | |
* QQWry.Dat文件指针 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>h5</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script> | |
<script src="exif.js"></script> | |
<style> | |
#holder { border: 1px dashed #ccc; width: 100px; height: 100px; margin: 20px auto;} | |
#holder.hover { border: 1px dashed #333; } | |
#result .property { width: 100px; } |
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
server { | |
root /var/www/example.com/static; | |
server_name example.com; | |
access_log /var/log/nginx/example.com.access.log; | |
error_log /var/log/nginx/example.com.error.log; | |
try_files /maintenance.html @proxy; | |
location @proxy { | |
proxy_pass http://127.0.0.1:10001; |
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 | |
file_put_contents( 'progress.txt', '' ); | |
$targetFile = fopen( 'testfile.iso', 'w' ); | |
$ch = curl_init( 'http://ftp.free.org/mirrors/releases.ubuntu-fr.org/11.04/ubuntu-11.04-desktop-i386-fr.iso' ); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt( $ch, CURLOPT_NOPROGRESS, false ); | |
curl_setopt( $ch, CURLOPT_PROGRESSFUNCTION, 'progressCallback' ); | |
curl_setopt( $ch, CURLOPT_FILE, $targetFile ); |
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 fs = require("fs"); | |
var path = require("path"); | |
var rmdir = function(dir) { | |
var list = fs.readdirSync(dir); | |
for(var i = 0; i < list.length; i++) { | |
var filename = path.join(dir, list[i]); | |
var stat = fs.statSync(filename); | |
if(filename == "." || filename == "..") { |
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 shExpMatch(url, pattern) { | |
var pCharCode; | |
var isAggressive = false; | |
var pIndex; | |
var urlIndex = 0; | |
var lastIndex; | |
var patternLength = pattern.length; | |
var urlLength = url.length; | |
for (pIndex = 0; pIndex < patternLength; pIndex += 1) { | |
pCharCode = pattern.charCodeAt(pIndex); // use charCodeAt for performance, see http://jsperf.com/charat-charcodeat-brackets |
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
Dim filePath, fileContents, dFileContents | |
filePath = "C:\" | |
' 查找所有 .lst 扩展名文件 | |
Dim fs, f, array1, f1 | |
Set fs = CreateObject("Scripting.FileSystemObject") | |
Set f = fs.GetFolder("C:\") | |
Set fc = f.Files | |
For Each f1 in fc |
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 | |
$one->one = 1; | |
$two->two->one = 21; | |
$two->two->two = 22; | |
$three->two->one = 31; | |
$return_obj = object_merge($one, $two, $three); | |
// returns: | |
// Array |
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 | |
$one->one = 1; | |
$two->two->one = 21; | |
$two->two->two = 22; | |
$three->two->one = 31; | |
$return_obj = object_merge($one, $two, $three); | |
// returns: | |
// Array |
OlderNewer