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
// ==UserScript== | |
// @name 豆藤 Bean vine | |
// @namespace http://userscripts.org/scripts/show/49911 | |
// @description 为豆瓣(www.douban.com)添加各种人性化的功能。 | |
// @require http://autoupdate.sinaapp.com/autoupdatehelper.js | |
// @include http* | |
// @version 2012.12.19 | |
// @grant GM_getValue | |
// @grant GM_setValue | |
// @grant GM_addStyle |
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 express = require('express') | |
, everyauth = require('../index') | |
, conf = require('./conf') | |
, everyauthRoot = __dirname + '/..'; | |
everyauth.debug = true; | |
var usersById = {}; | |
var nextUserId = 0; |
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
# 1. Make sure you have nginx sub module compiled in | |
# nginx -V 2>&1 | grep --color=always '\-\-with\-http_sub_module' | |
# 2. add two directives below at HTTP level | |
# nginx.conf | |
http { | |
# ...... | |
sub_filter '</head>' '<style type="text/css">html{ filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(100%); } img { _filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=0); -webkit-filter: grayscale(100%); } </style>'; |
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
<script type="text/javascript"> | |
// ========================================================================== | |
// Tooltips | |
// ========================================================================== | |
(function () { | |
var $tooltip = $('<div />'); | |
function showHideHandler(event) { | |
/*jshint validthis:true */ |
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 event = $.event, | |
scrollTimeout; | |
event.special.smartscroll = { | |
setup: function () { | |
$(this).bind("scroll", event.special.smartscroll.handler); | |
}, | |
teardown: function () { |
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
// The most basic JavaScript loader for any web page | |
var | |
// list of files to load | |
list = [ | |
'file1.js', | |
'file2.js' | |
], | |
// script dom node | |
script, | |
// script source string |
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
<!DOCTYPE html> | |
<title>Foo</title> | |
<script> | |
function c(a){var b=a instanceof Array?[]:{},d,e=Object.prototype.toString;for(d in a)b[d]=e.call({})==e.call(a[d])?c(a[d]):a[d];return b} | |
/*test cloning*/ | |
var obj = { omg: 'wow', sexypants : 'mikeyface', tester:function(){ console.log('ZOMGAH');}}, | |
test = c(obj); | |
console.log(obj); |
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
/** | |
$("img").lazyload({ | |
placeholder : "http://images.photo.bikestats.eu/zdjecie,600,89297,bike-stats-logo.jpg", | |
effect : "fadeIn" | |
}); | |
*/ | |
/** | |
<li class="pic-item"> |
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
/** | |
<div id="myCarousel" class="carousel slide"> | |
<ol class="carousel-indicators"> | |
<li data-target="#myCarousel" data-slide-to="0" class="active"></li> | |
<li data-target="#myCarousel" data-slide-to="1"></li> | |
<li data-target="#myCarousel" data-slide-to="2"></li> | |
</ol> | |
<!-- Carousel items --> | |
<div class="carousel-inner"> |