Skip to content

Instantly share code, notes, and snippets.

View danmaispace's full-sized avatar
🎯
Focusing

Danmai danmaispace

🎯
Focusing
  • www.danmai.com.cn
  • Shenzhen,China
View GitHub Profile
#!/bin/sh
# Inspired by :
# * http://blogs.atlassian.com/2012/01/moving-confluence-from-subversion-to-git/
# * http://john.albin.net/git/git-svn-migrate
# * http://blog.woobling.org/2009/06/git-svn-abandon.html
# * http://stackoverflow.com/questions/10637378/how-do-i-convert-a-bare-git-repository-into-a-normal-one-in-place
# usage: svn2git.sh REPO
# NOTE that we assume that REPO lives underneath SVN_URL and is a standard subversion layout
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
require 'bundler/capistrano'
set :application, "net"
set :repository, "git@githost.com:net.git"
set :scm, :git
set :default_environment, {
'PATH' => "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
}
@danmaispace
danmaispace / .vimrc.local
Created July 23, 2013 08:53
vimrc.local
"--------------------------------------------------------------------------
" My Vim Configuration
"--------------------------------------------------------------------------
syntax on " Syntax Highlight on
set nocompatible " Use vim advance settings
set nobackup " No backups
set autoread " Re-read if modified
set showcmd " Show panding commands
set cmdheight=1 " lines for command window
set laststatus=2 " Always show status line
@danmaispace
danmaispace / gist:5640898
Created May 24, 2013 02:31
search replace on regular expressions in Sublime Text 2
search replace on regular expressions in Sublime Text 2
Find: /images/(\w+).gif
Replace: /assets/\1.gif
Will replace "/images/logo.gif" to "/assets/logo.gif".
#unbind C-b
#set -g prefix C-a
setw -g mode-keys vi
# split window like vim
# vim's defination of a horizontal/vertical split is revised from tumx's
bind s split-window -h
bind v split-window -v
# move arount panes wiht hjkl, as one would in vim after C-w
bind h select-pane -L
[
{ "keys": ["ctrl+s"], "command": "toggle_side_bar" },
{ "keys": ["ctrl+shift+."], "command": "erb", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.ruby, text.haml, source.yaml, source.css, source.scss, source.js, source.coffee" }
]
},
{ "keys": ["ctrl+shift+t"], "command": "todo"},
{ "keys": ["ctrl+shift+i"], "command": "reindent"}
]
{
"color_scheme": "Packages/RailsCasts Colour Scheme/RailsCastsColorScheme.tmTheme",
"detect_slow_plugins": false,
"file_exclude_patterns":
[
".DS_Store",
".tags*",
"*.pyc",
"*.pyo",
"*.exe",
@danmaispace
danmaispace / writeup.md
Created October 12, 2012 02:10 — forked from cespare/writeup.md
A Simple Webserver Comparison

This is a very simple benchmark comparing the response times of a few different webservers for an extremely simple response: just reply with a snippet of static json. It came up in discussion of a real-life service: in the actual server, a long-running thread/process periodically updates the state from a database, but requests will be served with the data directly from memory. It is imperative, though, that the latencies be extremely low for this service.

This comparison was partly inspired by this blog post.

Method