Skip to content

Instantly share code, notes, and snippets.

View sorrycc's full-sized avatar
🌻
Working on Neovate Code

chencheng (云谦) sorrycc

🌻
Working on Neovate Code
View GitHub Profile
initHotProduct:function() {
$("div.J_Product").each(function() {
var el = this;
var swipe = Swipe(el, {
auto: 30000,
callback: function(pos) {
bullets.removeClass("on");
bullets[pos].className = "on";
}
});
/**
* @ref: http://static.xiaomi.cn/2014tv/index.html
*/
var g_count = 0;
var za = function() {
console.log("砸了" + (++g_count) + "次");
var index = Math.floor(Math.random()*3) + 1;
$("div.egg-" + index)[0].click();
// ==UserScript==
// @name 增加跳到收银台的链接.
// @version 0.1
// @match http://consumeprod.stable.alipay.net/*
// @copyright 2013+, 云谦
// ==/UserScript==
var els = document.querySelectorAll("p.consume-title a");
for (var i=0; i<els.length; i++) {
@sorrycc
sorrycc / pinboard.js
Created December 5, 2013 08:37
Pinboard Add.
// ==UserScript==
// @name Pinboard Add Script.
// @namespace http://use.i.E.your.homepage/
// @version 0.1
// @description enter something useful
// @match http://*/*
// @match https://*/*
// @copyright 2012+, You
// ==/UserScript==
@sorrycc
sorrycc / bacon.js
Created November 8, 2013 08:20
测试 new Image() 请求是否会阻塞 window.onload
<script>
new Image().src = "http://10.232.36.153/";
window.onload = function() {
alert(1);
};
</script>
require "open-uri"
data = []
while true
item = open("https://api.github.com/zen").read
if data.index(item) == nil
p item
data.push item
end
end
<!doctype html>
<html>
<body>
<div id="list"></div>
</body>
</html>
<script type="text/html" id="users">
11446911
2374833
// ==UserScript==
// @name AliWay Script.
// @version 0.2
// @match http://www.aliway.com/*
// @copyright 2012+, You
// ==/UserScript==
// 删水印
$("div.tpc_content").removeClass("tpc_content").css("padding", "0 15px 20px 15px").css("line-height", "1.5");
@sorrycc
sorrycc / gist:6180552
Created August 8, 2013 01:06
QQ Status Test Script. (Fail)
curl -I -H "Host: wpa.qq.com" -H "Connection: keep-alive" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36" -H "Accept-Encoding: gzip,deflate,sdch" -H "Accept-Language: zh-CN,zh;q=0.8" "http://wpa.qq.com/pa?p=1:64455361:1"
require "net/http"
def get_diff_percentage(url)
res = nil
res_webp = nil
url.sub!("http://", "")
server, *path = url.split("/")
path = "/#{path.join("/")}"
path_webp = "#{path}_.webp"