Skip to content

Instantly share code, notes, and snippets.

import requests
requests.post("http://localhost:12306/post",
files={
'key': ('filename', open('file', 'rb')),
},
data={"field1":"x", "field2":"y"},
)
qiniu.rpc.Client("localhost:12306").call_with_multipart("/post", [("field1", "x"), ("field2", "y")], files = [("file", "key", "data")])
python setup.py register sdist bdist_egg upload
@SunRunAway
SunRunAway / sublime-imfix.c
Last active December 15, 2015 22:38
sublime_text 输入法补丁
/*
sublime-imfix.c
Use LD_PRELOAD to interpose some function to fix sublime input method support for linux.
By Cjacker Huang <jianzhong.huang at i-soft.com.cn>
gcc -shared -o libsublime-imfix.so sublime-imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC
LD_PRELOAD=./libsublime-imfix.so sublime_text
*/
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
@SunRunAway
SunRunAway / editor.html
Last active December 12, 2015 03:38 — forked from minikomi/editor.html
data:text/html,
<style type="text/css">
#e {
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
font-size:16px;
}
package main
import (
"time"
"fmt"
"strings"
)
func main() {
p := [][][]string {
@SunRunAway
SunRunAway / rsMatchPrefix_test.go
Created November 19, 2012 07:29
rsMatchPrefix_test.go
package main
import (
"qbox.us/log"
rsapi "qbox.us/api/v2/rs"
"qbox.us/api/conf"
"qbox.us/digest_auth"
"encoding/json"
"fmt"
)