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 | |
/** | |
* 加密 hash,生成发送给用户的 hash 字符串 | |
* | |
* @param array $hash_data | |
* @param string $hash_key | |
* @return string | |
*/ | |
function encode_hash($hash_data, $hash_key = false) |
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
SELECT | |
Article_Detail_ID, | |
CASE find_in_set(aa.Alert_Source, 'O,A') | |
WHEN find_in_set(aa.Alert_Source, 'O,A') > 1 THEN | |
aa.Subject_ID | |
WHEN find_in_set(aa.Alert_Source, 'O,A') > 2 THEN | |
99 | |
ELSE | |
0 | |
END AS Subject_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
CREATE DEFINER=`root`@`%` FUNCTION `fn_sms_get_content`(`Article_Detail_ID_In` int,`Subject_ID_In` int, `Template_Type_In` CHAR(1)) RETURNS longtext CHARSET utf8 | |
BEGIN | |
DECLARE Content_Out LONGTEXT DEFAULT ''; | |
DECLARE Where_Condition VARCHAR(1000); | |
DECLARE Sql_Str VARCHAR(3000); | |
SET Where_Condition = CONCAT(CONCAT(' AND Article_Detail_ID=', Article_Detail_ID_In), CONCAT(" AND Template_Type=", Template_Type_In)); | |
IF Subject_ID_In !=0 THEN | |
Where_Condition = CONCAT(Where_Condition, CONCAT(' AND Subject_ID=', Subject_ID_In)); | |
ELSE |
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
#+BEGIN | |
#+UPDATE_TIME 2014-06-05 17:00:00 | |
#+MESSAGE | |
####################################################################### | |
# | |
# imouto.host | |
# | |
# #Ver : 1.68.0371 Myuseru foaran | |
# #Update Time : 2014.06.05;17:00 | |
# #Fix & Bug : 请参阅imouto.host.Readme.txt |
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 | |
$str = mb_convert_encoding($str, 'utf-16LE', 'utf8'); | |
echo md5($str); |
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
#-*- coding: UTF-8 -*- | |
import sys | |
import hashlib | |
def md5_file(filepath, raw_output=False, block_size=2*20): | |
md5 = hashlib.md5() | |
f = open(filepath, 'rb') | |
while True | |
content = f.read(block_size) | |
if not content: |
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
$.urlParam = function(name){ | |
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); | |
return results ? results[1] : false; | |
} |
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 getAllMethods($className){ | |
$class = new ReflectionClass($className); | |
$methods = $class->getMethods(); | |
foreach($methods as $k=>$method){ | |
//method type | |
if($method->isAbstract()){ | |
$methods[$k]->type = 'abstract'; | |
}else if($method->isFinal()){ |
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
// expires方法的参数是以秒为单位的,其他的方法跟localStorage的相同 | |
// 方法有:getItem/setItem/removeItem/clear/expires | |
// 30秒后过期 | |
storage.setItem("test","hello world").expires(30); | |
storage.setItem("test","hello world"); | |
storage.expires(30); | |
// clear全部由storage创建的localStorage |
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 | |
use Guzzle\Http\Client; | |
require __DIR__ . '/vendor/autoload.php'; | |
$tmpFile = tempnam(sys_get_temp_dir(), 'guzzle-download'); | |
$handle = fopen($tmpFile, 'w'); | |
$client = new Client('', array( | |
Client::CURL_OPTIONS => array( |
OlderNewer