This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import uuid | |
import marshal | |
import binascii | |
import tornado.web | |
def Session(func): | |
def warpper(self, *args, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" VIM配置文件 | |
" 设置语言及编码 | |
source $VIMRUNTIME/delmenu.vim | |
source $VIMRUNTIME/menu.vim | |
set enc=utf-8 | |
" set fencs=utf-8,ucs-bom,gbk,gb18030,shift-jis,gb2312,cp936 | |
" 常规设置 | |
set nocompatible " 关闭vi兼容模式 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'fanfou' | |
a = Fanfou::Fanfou::new('xxx', 'xxx') | |
a.get_authorize_url | |
a.get_access_token(a.request_token.token, a.request_token.secret, VERIFIER) # get from authorize url | |
a.fanfou_request '/statuses/home_timeline' | |
a.fanfou_request('/statuses/user_timeline', args = {:id => 'fanzeyi'}) | |
a.fanfou_request('/statuses/update', post_args = {:status => 'Hello'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Standard awesome library | |
require("awful") | |
require("awful.autofocus") | |
require("awful.rules") | |
-- Theme handling library | |
require("beautiful") | |
-- Notification library | |
require("naughty") | |
naughty.config.default_preset.width = 400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```C | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main() { | |
printf("Hello!"); | |
return 0; | |
} | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <dirent.h> | |
#include <errno.h> | |
#include <libgen.h> | |
#include <signal.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/resource.h> | |
#include <sys/types.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import socket | |
import struct | |
def dns_resolve(host, dnsserver): | |
assert isinstance(host, basestring) and isinstance(dnsserver, basestring) | |
index = os.urandom(2) | |
hoststr = ''.join(chr(len(x))+x for x in host.split('.')) | |
data = '%s\x01\x00\x00\x01\x00\x00\x00\x00\x00\x00%s\x00\x00\x01\x00\x01' % (index, hoststr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import logging | |
import urllib | |
from tornado.auth import httpclient | |
class RecaptchaMixin(object): | |
""" | |
Example usage:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request Header: | |
GET ws://localhost:8000/ HTTP/1.1 | |
Origin: http://localhost | |
Connection: Upgrade | |
Host: localhost:8000 | |
Sec-WebSocket-Key: 1K90MdhASDkOc0/yEpSPPQ== | |
Upgrade: websocket | |
Sec-WebSocket-Version: 13 |