Skip to content

Instantly share code, notes, and snippets.

@jinzhu
jinzhu / 0001-support-pass-variables-from-routes-to-handler.patch
Created February 26, 2012 15:42
[PATCH form Gorilla] support pass variables from routes to handler
From a948c13b7073af9a0af4e3615cf4a245056a42f2 Mon Sep 17 00:00:00 2001
From: Jinzhu <[email protected]>
Date: Sun, 26 Feb 2012 23:34:58 +0800
Subject: [PATCH] support pass variables from routes to handler
---
route.go | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/route.go b/route.go
@jinzhu
jinzhu / github.rb
Created March 19, 2012 06:50
Get hot vim scripts
require 'rubygems'
require 'rest_client'
require 'json'
watcher_threshold = 50
user = "vim-scripts"
results = []
url = "http://github.com/api/v2/json/repos/search/vim"
# url = "http://github.com/api/v2/json/repos/show/#{user}"
@jinzhu
jinzhu / gist:2904020
Created June 10, 2012 05:50 — forked from fennb/gist:1283573
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)
@jinzhu
jinzhu / gemfile.rb
Created November 4, 2012 04:57
Qor DSL examples
require 'qor_dsl'
module Gemfile
class Configuration
include Qor::Dsl
default_configs [ENV['BUNDLE_GEMFILE'], 'Gemfile']
node :gem
[:git, :path, :group].map do |name|
node name do

Manage your gmail account in emacs with mu4e

There're a lot of combinations to manage your email with emacs, but this works for me. I've a backup and I can manage my daily email.

The stack:

  • emacs
  • offlineimap
  • mu
  • mu4e
;;; tabbar+.el --- Tabbar extensions
;; Copyright (C) 2012
;; Author:
;; Keywords:
;; Version 0.2.2
;;; Commentary:
package main
import (
"fmt"
"log"
"os"
"runtime"
"runtime/debug"
"runtime/pprof"
"strconv"
fb629b0... 11/23/13 15:49 private
7479510 11/15/13 13:21 public
c4da64e... 04/29/13 12:56 public
5285857 04/02/13 00:08 public
5279532 03/31/13 12:20 public
dfca60f... 01/23/13 17:44 public
cec5482... 12/26/12 15:51 public
+ 4010380 11/04/12 12:57 public Qor DSL examples
2904020 06/10/12 13:50 public nginx microcaching config example
+ 2099624 03/19/12 14:50 public Get hot vim scripts
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
@jinzhu
jinzhu / README.md
Last active August 29, 2015 14:26 — forked from bodhi/README.md
The Telegram Problem

Implement the function handle to accept lines of text and output reformatted text, wrapped at columnWidth characters, without breaking words.

So

Yr brunch Godard, readymade pug Pinterest gastropub put a bird on it Tumblr.
Sartorial swag beard, selvage bitters tofu vinyl.
Tattooed kogi organic scenester heirloom, cred four loko cardigan cray meh Portland master cleanse photo booth Shoreditch farm-to-table.

when wrapped at 30 characters becomes