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
// MWWebSnapshot | |
// | |
// Created by Jim McGowan on 08/09/2010. | |
// Copyright 2010 Jim McGowan. All rights reserved. | |
// | |
// This code is made available under the BSD license. | |
// Please see the accompanying license.txt file | |
// or view the license online at http://www.malkinware.com/developer/License.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
// https://github.com/scottcorgan/contrast | |
var hexToRgb = require('hex-to-rgb'); | |
module.exports = function contrast (hex) { | |
var rgb = hexToRgb(hex); | |
var o = Math.round(((parseInt(rgb[0]) * 299) + (parseInt(rgb[1]) * 587) + (parseInt(rgb[2]) * 114)) /1000); | |
return (o <= 180) ? 'dark' : 'light'; | |
}; |
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
body { | |
height: auto; | |
min-height: 100%; | |
margin: 0; | |
padding: 0; | |
font-family: 'Helvetica Neue', "Hiragino Sans GB","Microsoft YaHei",sans-serif; | |
font-size: 14px; | |
-webkit-font-smoothing: antialiased; | |
} |
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
$('#slider a').click(function() { | |
history.pushState({ path: this.path }, '', this.href) | |
$.get(this.href, function(data) { | |
$('#slider').slideTo(data) | |
}) | |
return 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
$(window).bind('popstate', function() { | |
$('#slider').slideTo(location.pathname) | |
}) |
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
From -> http://www.cnblogs.com/zhengyun_ustc/archive/2010/10/26/1860897.html | |
############# | |
import urllib | |
import httplib2 | |
try: | |
from base import easyjson | |
except: | |
pass |
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> | |
<head> | |
<title>知乎阅读</title> | |
<meta charset="utf-8"> | |
<meta name="MobileOptimized" content="1024"> | |
<meta name="HandheldFriendly" content="True"> | |
<meta name="format-detection" content="telephone=no"> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
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
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="http://static.zhihu.com/static/img/reader/ipad-icon.png?ver=3" /> | |
<link rel="apple-touch-startup-image" href="http://static.zhihu.com/static/img/reader/ipad-splash-landscape.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape)" /> | |
<link rel="apple-touch-startup-image" href="http://static.zhihu.com/static/img/reader/ipad-splash-portrait.png" media="screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait)" /> | |
<link rel="stylesheet" href="http://static.zhihu.com/static/css/reader/main.css?v=1.8" type="text/css" media="screen" /> | |
<script type="text/javascript" src="http://static.evernote.com/noteit.js"></script> | |
<script type="text/javascript" src="http://static.zhihu.com/static/img/reader/scrollability.min.js"></script> | |
</head> |
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 type="text/javascript"> | |
function addEventSimple(obj,evt,fn){ | |
if(obj.addEventListener){ | |
obj.addEventListener(evt,fn,false); | |
}else if(obj.attachEvent){ | |
obj.attachEvent('on'+evt,fn); | |
} | |
} | |
addEventSimple(window,'load',init); | |
function 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 | |
function tranTime($time) { | |
$rtime = date("m-d H:i",$time); | |
$htime = date("H:i",$time); | |
$time = time() - $time; | |
if ($time < 60) { | |
$str = '刚刚'; | |
} |
OlderNewer