Skip to content

Instantly share code, notes, and snippets.

var list = new Array("Bulgaria", "93.123.23.1/59",
"Egypt", "197.199.253.1/59",
"Egypt", "197.199.254.1/59",
"Hong Kong", "218.189.25.129/187",
"Hong Kong", "218.253.0.76/92", "218.253.0.140/187",
"Iceland", "149.126.86.1/59",
"Indonesia", "111.92.162.4/6", "111.92.162.12/59",
"Iraq", "62.201.216.196/251",
"Japan", "218.176.242.4/251",
"Kenya", "41.84.159.12/30",
@mywaiting
mywaiting / recaptcha.py
Created July 4, 2014 14:29
Tornado-Recaptcha
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
import urllib.parse as urllib_parse # py3
except ImportError:
import urllib as urllib_parse # py2
import tornado
@mywaiting
mywaiting / test.html
Last active August 29, 2015 14:03
小小的JS测试题,可以试试看。
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
// require.js
this.require || this.define || (function() {
var head = document.getElementsByTagName("head")[0],
iModules = {},
oModules = {};

新闻w

RHEL 7 发布应该算是比较大的新闻了吧~

人民群众纷纷表示红帽步子太大不要扯着蛋了比较好...

F_XZ: 完全没关心...

猫注意的新功能有 virtio 等 KVM 优化, docker 支持, 以及 ruby 2.0, python 2.7, java 7 之类的吧

@mywaiting
mywaiting / XDRequest.js
Created March 16, 2012 13:07
跨域的XMLHTTPRequest封装,配合IFrame的兼容实现!采摘自InstaPaper的实现,仔细功能还需要细化,但基本可以使用!
/**
@Description: 发送跨域XMLHTTPRequest到Server,Server必须回应HTTP头部 Access-Control-Allow-Origin
@Support: IE8+, Firefox 3.5+, Safari 4+, Opera 9+, Chrome
@Refer:
http://www.denisdeng.com/?p=1024
http://blog.csdn.net/doraeimo/article/details/7329779
*/
function createXDPostRequest(method, url, payload, success, error) {
try {
@mywaiting
mywaiting / tornado_static.py
Created May 20, 2012 04:26 — forked from peterbe/tornado_static.py
tornado_static
"""
tornado_static is a module for displaying static resources in a Tornado web
application.
It can take care of merging, compressing and giving URLs ideal renamings
suitable for aggressive HTTP caching.
(c) mail@peterbe.com
"""
@mywaiting
mywaiting / gist:2792038
Created May 26, 2012 03:47 — forked from jparise/gist:2789026
Protocol Buffer Mixin for Tornado
class ProtocolBufferMixin(object):
"""Protocol Buffer support for RequestHandler objects."""
MIMETYPE = 'application/x-protobuf'
def read_protobuf(self, message_type, data):
"""Attempts to parse a protocol buffer message from the given data."""
# Create the message object and attempt to parse the data into it.
try:
message = message_type()
@mywaiting
mywaiting / gist:3452130
Created August 24, 2012 15:42 — forked from mitchellh/gist:1241519
reCaptcha field for WTForms
"""
Contains reCaptcha fields for WTForms which can be used
for various forms. This library depends on `recaptcha-client` ~> 1.0.6.
Example usage is below.
Defining a form with a ``RecaptchaField``:
from wtforms import Form
from recaptcha_field import RecaptchaField
@mywaiting
mywaiting / rules-both.iptables
Created November 11, 2015 17:34 — forked from jirutka/rules-both.iptables
Basic iptables template for ordinary servers (both IPv4 and IPv6)
###############################################################################
# The MIT License
#
# Copyright 2012-2014 Jakub Jirutka <jakub@jirutka.cz>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@mywaiting
mywaiting / require.quora.js
Last active December 26, 2015 00:39
Quora Require for Browser in 2013-10-20
this.require || function(global, undefined) {
/**
require
var module = require("ModuleName");
*/
function require(a) {
if (!exported[a]) {
rec("loader.require", "Required", a);
var b, c = installed[a];