Skip to content

Instantly share code, notes, and snippets.

View yesmeck's full-sized avatar
:octocat:
<img src="x" onerror="alert(1)" />

Wei Zhu yesmeck

:octocat:
<img src="x" onerror="alert(1)" />
View GitHub Profile
@yesmeck
yesmeck / douban_rating.user.js
Created January 31, 2012 02:32
Douban Rating
// ==UserScript==
// @version 1.0
// @name Douban Rating
// @author Zhou Meng
// @description Show Douban Rating in Douban List
// @include http://*.douban.com/doulist/*
// ==/UserScript==
if ('undefined' == typeof __PAGE_SCOPE_RUN__) {
//把当前脚本注入到页面
@yesmeck
yesmeck / pastbin.sh
Created March 19, 2012 02:54
CLI Pastebin within VimEnergy
#!/usr/bin/env bash
#
# Usage:
#
# ./pastbin.sh FILE
#
file=$1
ext=$(echo $file | grep -oP '\..{2,3}' | grep -oP '[a-z]+')
@yesmeck
yesmeck / interfaces
Created March 22, 2012 02:30
Set up bridge network interface on VirtualBox
# /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
apt-get install build-essential linux-headers-`uname -r`
@yesmeck
yesmeck / README.md
Created August 14, 2012 15:12
Storing Hierarchical Data in a Database

Storing Hierarchical Data in a Database

@yesmeck
yesmeck / star.sh
Created September 19, 2012 02:20
star in bash
#!/bin/bash
puts() {
echo $1
}
puts '*'
@yesmeck
yesmeck / movie_review_create.sh
Created September 20, 2012 18:03
douban movie reviews api
% http --form POST https://api.douban.com/v2/movie/reviews Authorization:"Bearer a427972a77c120c4e576c57f6743624c" movie=07931 title=测试 content="因为,绳命,是剁么的回晃;绳命,是入刺的井猜。壤窝们,巩痛嘱咐碰优。田下冯广宰饿妹,饿妹冯广宰呲呲处。壤窝们,嘱咐这缩优类缩优。开心的一小,火大的一小,壤绳命,梗楤容,壤绳命,梗秤巩,壤绳命,梗回晃。" rating=5 -v
POST /v2/movie/reviews HTTP/1.1
Accept-Encoding: identity, deflate, compress, gzip
Accept: */*
User-Agent: HTTPie/0.2.7
Host: api.douban.com
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Authorization: Bearer a427972a77c320c4ec76c57f6743624c
movie=1307931&title=%E6%B5%8B%E8%AF%95&content=%E5%9B%A0%E4%B8%BA%EF%BC%8C%E7%BB%B3%E5%91%BD%EF%BC%8C%E6%98%AF%E5%89%81%E4%B9%88%E7%9A%84%E5%9B%9E%E6%99%83%EF%BC%9B%E7%BB%B3%E5%91%BD%EF%BC%8C%E6%98%AF%E5%85%A5%E5%88%BA%E7%9A%84%E4%BA%95%E7%8C%9C%E3%80%82%E5%A3%A4%E7%AA%9D%E4%BB%AC%EF%BC%8C%E5%B7%A9%E7%97%9B%E5%98%B1%E5%92%90%E7%A2%B0%E4%BC%98%E3%80%82%E7%94%B0%E4%B8%8B%E5%86%AF%E5%B9%BF%E5%AE%B0%E9%A5%BF%E5%A6%B9%EF%BC%8C%E9%A5%BF%E5%A6%B9%E5%86%AF%E5%B9%BF%E5%AE%B0%E5%91%B2%E5%A4%84%E3%80%82%E5%A3%A
@yesmeck
yesmeck / discussion.md
Created September 27, 2012 12:52
豆瓣 API

获取讨论列表GET https://api.douban.com/v2/target/:id/discussions这里的 target 是不是要替换成 movie、book 这样的?不管我怎么弄都是返回 404。

% http GET https://api.douban.com/v2/target/1915561/discussions  -v
GET /v2/target/1915561/discussions HTTP/1.1
Accept: */*
Accept-Encoding: identity, deflate, compress, gzip
Host: api.douban.com
User-Agent: HTTPie/0.3.0

@yesmeck
yesmeck / AlphaTaxi.user.js
Created November 20, 2012 06:01
阿尔法城的出租车~
// ==UserScript==
// @name AlphaTaxi
// @namespace http://yesmeck.com
// @description 阿尔法城出租车
// @include http://alphatown.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @version 1.0
// ==/UserScript==
$(function() {
@yesmeck
yesmeck / git-flow.md
Created December 9, 2012 14:53
Git 开发流程

Git 协作流程

master 分支

master 永远处于稳定状态,这个分支代码可以随时用来部署。不允许在该分支直接提交代码。

develop 分支

开发分支,包含了项目最新的功能和代码,所有开发都在 develop 上进行。一般情况下小的修改直接在这个分支上提交代码。