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 check_gif($path) | |
{ | |
// Reads entire file into a string | |
$content = file_get_contents($path); | |
// Find GIF89a in a string | |
$bool = strpos($content, 'GIF89a'); | |
if($bool === FALSE) | |
{ | |
// Find NETSCAPE2.0 in a string | |
return strpos($content, chr(0x21).chr(0xff).chr(0x0b).'NETSCAPE2.0')===FALSE?0:1; |
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
USE db_article; | |
drop procedure click_insert; | |
DELIMITER // | |
CREATE PROCEDURE click_insert() | |
BEGIN | |
DECLARE rarcid INT; |
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
.message-box { | |
position:relative; | |
width:240px; | |
height:60px; | |
line-height:60px; | |
background:#E9FBE4; | |
box-shadow:1px 2px 3px #E9FBE4; | |
border:1px solid #C9E9C0; | |
border-radius:4px; | |
text-align:center; |
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
var person = new Object(); | |
person.name = 'cloudsben'; | |
person.age = 23; | |
person.job = 'Web Developer'; | |
person.sayName = function(){ | |
alert(this.name); | |
} | |
person.sayName(); |
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 if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* @ignore | |
*/ | |
class OAuthException extends Exception { | |
// pass | |
} | |
class Oauth2_lib { |
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
cat new_fix_click.txt|awk '/^[0-9 ]+$/ {print "call fix_click("$1","$2");"}' |
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 | |
for i in $(seq 0 $2) | |
do | |
echo $i | |
convert -density 72 $1[$i] thumb-$i.png | |
done |
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 getNumPagesInPDF($PDFPath) | |
{ | |
$stream = @fopen($PDFPath, "r"); | |
$PDFContent = @fread ($stream, filesize($PDFPath)); | |
if(!$stream || !$PDFContent) | |
return false; | |
$firstValue = 0; | |
$secondValue = 0; | |
if(preg_match("/\/N\s+([0-9]+)/", $PDFContent, $matches)) { | |
$firstValue = $matches[1]; |
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
public function format_time($create_time) | |
{ | |
$time = time() - $create_time; | |
switch ($time) { | |
case $time < 3600: | |
$now = ceil($time/60).'分钟前'; | |
break; | |
case $time < 3600*24: |
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 | |
for($i=0;$i< 90000; $i++) | |
{ | |
$a .= ','.rand(10000,99999); | |
} | |
// $b = explode(',', $a); | |
// $c =array_slice($b, 0, 20); | |
// var_dump($c); | |
$cc = 0;$pos = 0; | |
echo $a[0]; |
OlderNewer