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 embed_images($content){ | |
$embed_images = preg_replace_callback('/https?:\/\/([A-z0-9]+[_\-]?[A-z0-9]+\.)*[A-z0-9]+\-?[A-z0-9]+\.[A-z]{2,}(\/.*)*\/?/i', "addimg",$content); | |
return $embed_images; | |
} | |
function addimg($url){ | |
global $post; | |
$title = $post ->post_title; | |
$imgurl = preg_replace('/((^http[s]{0,1}:)\/\/(.+).(gif|jpg|bmp|png))/i', '<img src="$1" alt="'.$title.'" /><pre>$1</pre>',$url[0]); | |
if($imgurl !== $url[0]){ |
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 embed_images($content){ | |
return preg_replace('/(https?\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(?:\/\S*?)?(?:[a-zA-Z0-9_])+\.(?:jpg|jpeg|gif|png))/i', '<img src="$1"/>', $content); | |
} | |
add_filter(the_content', 'embed_images'); |
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
#Main>.box>.inner>table>tbody>tr, #Main>.box>.cell>table>tbody>tr{ | |
position:relative; | |
} | |
#Main>.box>.inner>table>tbody>tr>td:nth-child(3), #Main>.box>.cell>table>tbody>tr>td:nth-child(3){ | |
padding-right: 4em; | |
} | |
#Main>.box>.inner>table>tbody>tr>td:nth-child(4), #Main>.box>.cell>table>tbody>tr>td:nth-child(4){ | |
position:absolute; | |
top:0px; | |
right:8px; |
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
window.addEventListener('load', function(){ | |
var body = document.body, | |
html = document.documentElement; | |
var height = Math.max( body.scrollHeight, body.offsetHeight, | |
html.clientHeight, html.scrollHeight, html.offsetHeight ); | |
console.log(height/2 - window.innerHeight/2); | |
window.scrollTo(0, height/2 - window.innerHeight/2); | |
}); |
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
//output: | |
//906609 | |
//993*913 | |
//cost: 0.122 secs | |
var start = new Date() | |
var last = 0; | |
var lastTxt = ''; | |
for (var i = 999; i > 99; i--){ | |
for(var j = 999; j > 99; j--){ | |
var val = i*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
<script> | |
function match(input, rule, matched){ | |
if(input.length == 0 && rule.length != 0){ | |
return ''; | |
} | |
if(rule.length == 0){ | |
return matched; | |
} | |
var c1 = rule[0]; | |
var c2 = input[0]; |
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 re = /([\[\]\,.?"\(\)+_*\/\\&\$#^@!%~`<>:;\{\}?,。·!¥……()+{}【】、|《》]|(?!\s)'\s+|\s+'(?!\s))/ig; | |
content.replace(re, ''); |
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
Nimbus.angularService = ()-> | |
(name, attrs, sync_callback)-> | |
store = Nimbus.Model.setup(name, attrs) | |
store.sync_all(sync_callback) | |
store |
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
ceaser_code = function(comb){ | |
for(var offset = 1; offset < 27; offset++){ | |
var output = ""; | |
for(var i in comb){ | |
var ch = comb.charCodeAt(i); | |
ch = ch + offset > 122? 97 + ch + offset -122: ch+offset; | |
output += String.fromCharCode(ch); | |
} | |
console.log(offset + ':' + output); |
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
{ | |
"tag1": "明星", | |
"tag2": "刘诗诗", | |
"totalNum": 1314, | |
"start_index": 0, | |
"return_number": 30, | |
"data": [ | |
{ | |
"id": "4859542230", | |
"pn": 0, |
OlderNewer