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 sieve = function(num) { | |
var arr = [], | |
primes = [], | |
i = 0, | |
curPrime; | |
num = parseInt(num); | |
if (isNaN(num) || num < 2) { | |
return primes; | |
} |
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($){ | |
$.fn.lazyload = function(options){ | |
var $container = options.$container, | |
$window = $(window), | |
elems = []; | |
options = $.extend({ | |
attr: 'data-lazyload', | |
$container: $window, | |
advance: 100, |
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
[global] | |
email = [email protected] | |
password = your_email_password | |
host = smtp.your_email_host.com |
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 http = require('http'), | |
https = require('https'), | |
iconv = require('iconv-lite'), | |
url = require('url'), | |
querystring = require('querystring'), | |
fs = require('fs'); | |
var request = module.exports = {}; | |
function parseUrl(urlStr){ |
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 BrainFuck = (function(){ | |
function getBracketsPair(code){ | |
var stack = [], | |
bracket = [], | |
start, | |
i,l; | |
for (i = 0, l = code.length; i < l; i++ ) { | |
if (code[i] === '[') { | |
stack.push(i); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" | |
xmlns:moz="http://www.mozilla.org/2006/browser/search/"> | |
<ShortName>Bilibili-Search</ShortName> | |
<Description>Search in Bilibili</Description> | |
<InputEncoding>UTF-8</InputEncoding> | |
<Image width="16" height="16">http://www.bilibili.com/favicon.ico</Image> | |
<Url type="text/html" method="GET" template="http://www.bilibili.com/search?keyword={searchTerms}"> | |
</Url> | |
<moz:SearchForm>http://www.bilibili.com/</moz:SearchForm> |
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
// ==UserScript== | |
// @name GitPaste | |
// @name:zh-CN GitPaste | |
// @author Hakurouken | |
// @description copy github && gist code quickly | |
// @description:zh-cn 快速的复制 github 和 gist 的代码 | |
// @namespace GitPaste/Hakurouken | |
// @icon https://github.com/favicon.ico | |
// @encoding utf-8 | |
// @date 12/04/2015 |
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($) { | |
var cache = {}; | |
var partial = function(str) { | |
return str.replace(/<%\+(.*)%>/, function(child, name) { | |
name = name.trim(); | |
return !/[^\w-_]/.test(name) ? document.getElementById(name).innerHTML : name; | |
}); | |
}; |
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 Cache = (function(global){ | |
var Cache = {}; | |
var storage = global.localStorage; | |
Cache.isSupport = (function(){ | |
return !!storage; | |
})(); | |
Cache.set = function(key,val){ |
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 (root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define([], factory); | |
} else if (typeof exports === 'object') { | |
module.exports = factory(); | |
} else { | |
root['strHash'] = factory(); | |
} | |
}(this, function () { | |
var strHash = { |
OlderNewer