Skip to content

Instantly share code, notes, and snippets.

View sorrycc's full-sized avatar
🌻
Working on UmiJS

chencheng (云谦) sorrycc

🌻
Working on UmiJS
View GitHub Profile
@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"
Process: AliWangwang [48626]
Path: /Applications/AliWangwang.app/Contents/MacOS/AliWangwang
Identifier: com.taobao.aliwangwang
Version: 3.0.4 (2596)
Code Type: X86 (Native)
Parent Process: launchd [137]
User ID: 501
Date/Time: 2013-03-06 10:48:27.253 +0800
OS Version: Mac OS X 10.8.2 (12C60)
set the_array to {}
tell application "Finder"
set these_items to the selection
end tell
repeat with i from 1 to the count of these_items
set end of the_array to ""
set this_item to (item i of these_items) as text
tell application "TPSMate"
helper = require "./_grunt_helper"
_config = require "./_config"
path = require "path"
fs = require "fs"
ModuleCompiler = require "module-compiler"
JS_SRC = path.join __dirname, "./src/javascripts/"
CSS_SRC = path.join __dirname, "./src/stylesheets/"
BUILD_SRC = path.join __dirname, "./build/#{_config.timestamp}/hy/"
@sorrycc
sorrycc / fp2012_module structure.js
Created March 19, 2012 05:51
fp2012_module structure
/**
* @fileOverview 本地生活模块.
* @author 云谦 <[email protected]>
*/
KISSY.add('fp/local/local', function(S, Module, util, DOM) {
function Local() {
Local.superclass.constructor.apply(this, arguments);