Skip to content

Instantly share code, notes, and snippets.

@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"
)
package main
import (
"time"
"fmt"
"strings"
)
func main() {
p := [][][]string {
@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;
}
@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>
python setup.py register sdist bdist_egg upload
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")])
curl -T file.json -X POST "http://localhost/uri"
@SunRunAway
SunRunAway / cheapest-steam.go
Last active August 29, 2015 13:59
cheapest-steam
/*
cheapest-steam
==============
A crawler to retrieve cheapest item price on steam.
```
go run main.go -url http://steamcommunity.com/market/listings/570/Taunt%3A%20Get%20Burned
```
*/
@SunRunAway
SunRunAway / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// ==UserScript==
// @name Google SSL Privacy Real Link
// @namespace http://userscripts.org/scripts/show/145014
// @description Mandatory use encryption connection https. Gets rid of almost every google tracking device. Disable the Google search rewrite, always showing and using the real, original, direct link URLs, also to prevent from using redirected pages that might be temporarily unavailable in some area.
// @include http://images.google.*/images*
// @include http://www.google.*/images*
// @include http://www.google.*/webhp*
// @include http://www.google.*/search?*
// @include http://www.google.*/imgres*
// @include http://images.google.*/search?*