Skip to content

Instantly share code, notes, and snippets.

"""
This is a simple example of WebSocket + Tornado + Redis Pub/Sub usage.
Do not forget to replace YOURSERVER by the correct value.
Keep in mind that you need the *very latest* version of your web browser.
You also need to add Jacob Kristhammar's websocket implementation to Tornado:
Grab it here:
http://gist.github.com/526746
Or clone my fork of Tornado with websocket included:
http://github.com/pelletier/tornado
Oh and the Pub/Sub protocol is only available in Redis 2.0.0:
@jmoiron
jmoiron / crawler.py
Created May 27, 2011 20:37
Simple gevent/httplib2 web crawler.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Simple async crawler/callback queue based on gevent."""
import traceback
import logging
import httplib2
import gevent
@cdgz
cdgz / crawl.py
Created October 25, 2011 15:14 — forked from jonhurlock/crawl.py
Python Web Crawler - jonhurlock
#!/usr/bin/env python
"""
Simple Indexer
=================================
Author: Jon Hurlock, October 2011
This script basically crawls a domain (not just a page) and
then extracts all links <a href=""></a>, and finds all links
on that domain it also is able extract different file types
@ProximaMonkey
ProximaMonkey / weibo.py
Created February 20, 2012 16:40 — forked from mazesoul87/weibo.py
weibo oauth
#encoding:utf-8
import logging
import time
import urllib
import mimetools
from tornado import httpclient
from tornado.httputil import HTTPHeaders
from tornado import escape
from tornado.auth import OAuthMixin,OAuth2Mixin
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@lanius
lanius / index.html
Created May 6, 2012 03:51
Handle URL pattern in WebSocketHandler for Tornado
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tornado WebSocket Sample</title>
</head>
<body>
<input type="text" id="username" value="myname" />
<button id="connect">connect</button>
<div id="result"></div>
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active June 3, 2024 09:11
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
@dongyuwei
dongyuwei / weibo_wap.js
Created August 14, 2012 07:45
自动登陆新浪微博移动版( http://m.weibo.cn ) 发微博
var http = require('http');
var qs = require('querystring');
function parse_response(res, callback) {
var list = [];
res.on('data', function(chunk) {
list.push(chunk);
});
res.on('end', function() {
callback(Buffer.concat(list).toString());
@cuimuxi
cuimuxi / gist:3719516
Created September 14, 2012 02:50
gevent crawler
import gevent
from gevent import monkey, queue
monkey.patch_all()
import urllib2
from time import sleep
import traceback
import logging
@onlytiancai
onlytiancai / python_infrastructure.md
Created October 12, 2012 08:55
python 基础设施讨论贴

python项目通用组件和基础服务

很多公司都大量使用了python,其中有一些开发规范,code guidline, 通用组件,基础框架是可以共用的。

每个公司都自己搞一套, 太浪费人力,我想开一帖和大家讨论一下这些python基础设施的搭建。

原则是我们尽量不重新发明轮子,但开源组件这么多,也要有个挑选的过程和组合使用的过程,在这里讨论一下。

另一方面,有些开源组件虽然强大,但我们不能完全的驾驭它,或只使用其中很少的一部分,我们就可以考虑用python实现一个简单的轮子,可控性更强,最好不要超过300行代码。