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> | |
<body> | |
<p id="demo">Click the button to display a random number.</p> | |
<button onclick="myFunction()">Try it</button> | |
<script> | |
function myFunction() |
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 unicode_decode($name) { | |
// 转换编码,将Unicode编码转换成可以浏览的utf-8编码 | |
$pattern = '/([\w]+)|(\\\u([\w]{4}))/i'; | |
preg_match_all($pattern, $name, $matches); | |
if (!empty($matches)) { | |
$name = ''; | |
for ($j = 0; $j < count($matches[0]); $j++) { | |
$str = $matches[0][$j]; |
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
public class MvcApplication : System.Web.HttpApplication | |
{ | |
protected void Application_Start() | |
{ | |
AreaRegistration.RegisterAllAreas(); | |
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); | |
RouteConfig.RegisterRoutes(RouteTable.Routes); | |
BundleConfig.RegisterBundles(BundleTable.Bundles); | |
} | |
public override void Init() |
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 | |
try { | |
$dbh = new PDO('mysql:host=localhost;dbname=mytest', 'root', '123', array( | |
PDO::ATTR_PERSISTENT => true)); | |
$rows = array( | |
array(null, 'def', time()), | |
array(null, 'def', time()), | |
array(null, 'def', time()), |
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 postcurl($curlPost) { | |
$ch = curl_init(); //初始化curl | |
curl_setopt($ch, CURLOPT_URL, 'http://host/index.php?url'); //抓取指定网页 | |
//curl_setopt($ch, CURLOPT_HEADER, 0); //设置header | |
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //要求结果为字符串且输出到屏幕上 | |
curl_setopt($ch, CURLOPT_POST, 1); //post提交方式 | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost); | |
$data = curl_exec($ch); //运行curl | |
echo ($data); |
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 guid() { | |
function s4() { | |
return Math.floor((1 + Math.random()) * 0x10000) | |
.toString(16) | |
.substring(1); | |
} | |
return s4() + s4() + '-' + s4() + '-' + s4() + '-' + | |
s4() + '-' + s4() + s4() + s4(); | |
} |
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
#无良网络运营商,劫持用户上网信息,牟取广告利润 | |
#制作此hosts文件,让其劫持失效 | |
#内容保存到C:\Windows\System32\drivers\etc\hosts | |
127.0.0.1 count.chanet.com.cn | |
127.0.0.1 p.yiqifa.com |
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/sh | |
### BEGIN INIT INFO | |
# Provides: php-fpm | |
# Required-Start: $remote_fs $network | |
# Required-Stop: $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts php-fpm | |
# Description: starts the PHP FastCGI Process Manager daemon |
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 | |
class person { | |
public $name; | |
public $price; | |
function __construct($name, $price) { | |
$this->name = $name; | |
$this->price = $price; | |
} | |
} |
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
/* | |
demo | |
today = new Date(); | |
var dateString = today.format("dd-m-yy"); | |
alert(dateString); | |
source http://jsfiddle.net/phZr7/1/ | |
* Date Format 1.2.3 | |
* (c) 2007-2009 Steven Levithan <stevenlevithan.com> |
OlderNewer