Skip to content

Instantly share code, notes, and snippets.

@benzhe
benzhe / genesis_public_key
Created February 8, 2018 17:54
genesis_public_key
04963c638a5d1995fffd6071bc4a3f71d59ba7a3d2976e46a411ff3ae50517cfe130b22943de8e7e4822957e9c25f30fcae3e314d7b041446bd2cc2f449dfab6b5
@benzhe
benzhe / genesis_public_key
Created February 8, 2018 17:52
genesis_public_key
04963c638a5d1995fffd6071bc4a3f71d59ba7a3d2976e46a411ff3ae50517cfe130b22943de8e7e4822957e9c25f30fcae3e314d7b041446bd2cc2f449dfab6b5
@benzhe
benzhe / scale.js
Created October 25, 2017 11:11
scale.js
(function() {
var width = window.screen.width;
var scaleStr = 'initial-scale=' + (width / 750).toFixed(2);
var el = document.createElement('meta');
el.setAttribute('name', 'viewport');
el.setAttribute('content', 'width=750, ' + scaleStr + ', user-scalable=no');
document.head.appendChild(el);
function setScale() {
setTimeout(function() {
<?php
//var_dump($_SERVER);die;
$etag = "008:0";
if(isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $etag && $_SERVER['HTTP_HOST'] != "localhost") {
header("HTTP/1.1 304 Not Modified", True, 304);die;
}
$colorMap = array("f0f8ff"=>"aliceblue", "faebd7"=>"antiquewhite", "00ffff"=>"aqua", "7fffd4"=>"aquamarine", "f0ffff"=>"azure", "f5f5dc"=>"beige", "ffe4c4"=>"bisque", "000000"=>"black", "ffebcd"=>"blanchedalmond", "0000ff"=>"blue", "8a2be2"=>"blueviolet", "a52a2a"=>"brown", "deb887"=>"burlywood", "5f9ea0"=>"cadetblue", "7fff00"=>"chartreuse", "d2691e"=>"chocolate", "ff7f50"=>"coral", "6495ed"=>"cornflowerblue", "fff8dc"=>"cornsilk", "dc143c"=>"crimson", "00ffff"=>"cyan", "00008b"=>"darkblue", "008b8b"=>"darkcyan", "b8860b"=>"darkgoldenrod", "a9a9a9"=>"darkgray", "a9a9a9"=>"darkgrey", "006400"=>"darkgreen", "bdb76b"=>"darkkhaki", "8b008b"=>"darkmagenta", "556b2f"=>"darkolivegreen", "ff8c00"=>"darkorange", "9932cc"=>"darkorchid", "8b0000"=>"darkred", "e9967a"=>"darksalmon", "8fbc8
(function(){
if(window && document && document.documentElement){
document.documentElement.className += " pad-container";
}
else {
setTimeout(arguments.callee, 100);
}
})()
@-webkit-keyframes runfor {
0% {
-webkit-transform: translateX(0) scale(1);
}
30% {
-webkit-transform: translateX(0) scale(.75);
}
70% {
打开 http://photo.weibo.com/3329924902/talbum/index?from=profile_wb#!/mode/2/page/1
在终端输入
var xhr = new XMLHttpRequest;
window.List = [];
xhr.open("GET","http://photo.weibo.com/photos/get_all?uid=3329924902&album_id=3572827348456361&count=800&page=1&type=3")
xhr.onloadend = function(ev){obj = JSON.parse(xhr.responseText); data = window.photoData = obj.data.photo_list; data.map(function(item,key){if(item && item.pic_host) (List[key] = new Image()).src=item.pic_host+"/mw690/"+item.pic_name})}
xhr.send()
// wait for 1 minute.....
<script>document.domain="xxx"</script>
{
"status": 1,
"data": [
{
"name": "屏幕快照 2013-04-09 下午4.26.29.png",
"url": "http://img.la/blue/200x200"
},
{
"name": "屏幕快照 2013-04-09 下午4.21.13.png",
var nums = [0,0,0,0],
n = 1000000;
var rand=function(){return parseInt(Math.random()*10)};
function jiaoji_count(val){
var count = 0,a=val[0],b=val[1];
for(var m = 0;m<a.length;m++){
for(var n=0;n<b.length;n++){
if(a[m] == b[n]){count++;b.splice(n,1);break;}}}
return count;
}

1