Skip to content

Instantly share code, notes, and snippets.

irachex /
Created May 8, 2012
CORS Server that supports Access-Control-Allow-Origin
import SimpleHTTPServer
import SocketServer
import time
import os
import socket
class TestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
irachex / onlylz.js
Created Dec 30, 2011
View onlylz.js
javascript:(function(){u=$(".topic-content .user-face a").attr("href");a=window.location.href.match(/\/(\d+)\//)[1];$("li.clearfix:not(:has(h4 a[href="+u+"]))").hide();h=$(".paginator");j=h.find(">a:last").text();k=1;$a=new Array;c=new Array;for(i=1;i<j;i++){$.ajax({url:"/group/topic/"+a+"/?start="+(i*100),success:function(data){d=$(data);n=d.find(".thispage").text()-1;$a[n]=d.find("li.clearfix:has(h4 a[href="+u+"])");c[n]=d.find(".paginator").html();if(n==k){do{$a[k].appendTo($(".topic-reply"));h.html(c[k]);k++;}while($a[k]!=undefined);}}});}})()
irachex / doubanRefresh.js
Created Dec 23, 2011
auto refresh douban shuo.use it when you want to coding and checking douban at the same time.usage: add to bookmark.
View doubanRefresh.js
View snow.js
Snow Fall 1 - no images - Java Script
for this script and many more
// Set the number of snowflakes (more than 30 - 40 not recommended)
var snowmax=35;
// Set the colors for the snow. Add as many colors as you like
irachex / RestartmDNSResponder
Created Dec 16, 2011
Restart mDNSResponder if it's not responsible (just for MacOS) Run this script as root via cron.
View RestartmDNSResponder
#!/usr/bin/env python
""" Restart mDNSResponder if it's not responsible (just for MacOS)
Run this script as root via cron.
* * * * * /Users/xupeng/bin/
import os
You can’t perform that action at this time.