Skip to content

Instantly share code, notes, and snippets.

View zires's full-sized avatar
🎎
anxiety

zshuaibin zires

🎎
anxiety
View GitHub Profile
@zires
zires / vertical.css
Created December 29, 2011 07:05
垂直居中
<div class="wrap">
<div class="hack">
<div class="cnt">
content
</div>
</div>
</div>
/* CSS 部分的代码实现:整体代码参见上述 demo*/
.wrap{
@zires
zires / change log
Created January 6, 2012 02:09
Rails 3.2.0.rc2
## IMPORTANT
**Support for Rails 2.3-style plugins (vendor/plugins!) will be
removed in Rails 4.0. Move them out and bundle them in your Gemfile,
or fold them in to your app as lib/myplugin/* and
config/initializers/myplugin.rb**
## CHANGES since RC1
*ActionMailer*
@zires
zires / tests.watchr
Created February 14, 2012 07:02 — forked from boxedup/tests.watchr
ENV["WATCHR"] = "1"
system 'clear'
def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
image = message.include?('0 failures, 0 errors') ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)
end
@zires
zires / installation.sh
Created April 28, 2012 03:08 — forked from mikhailov/installation.sh
Nginx+passenger application config: ssl redirection, http headers, passenger optimal settings. see details: http://mikhailov.posterous.com/nginx
$ cd /usr/src
$ wget http://nginx.org/download/nginx-0.8.52.tar.gz
$ tar xzvf ./nginx-0.8.52.tar.gz
$ rm ./nginx-0.8.52.tar.gz
$ gem install s3sync capistrano capistrano-ext passenger --no-ri --no-rdoc
$ passenger-install-nginx-module
# Automatically download and install Nginx? 2. No: I want to customize my Nginx installation
# Where is your Nginx source code located?: /usr/src/nginx-0.8.52
# Where do you want to install Nginx to?: /opt/nginx
@zires
zires / clear
Created June 6, 2012 02:15
Solr clear all data
http://127.0.0.1:8080/solr/update?stream.body=%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E&commit=true
@zires
zires / mount.sh
Created June 7, 2012 07:23
mount shared file form windows7 to unix
sudo mount -t cifs //Win7/shared -o username=User,password=Password /mnt/shared
@zires
zires / .vimrc.before
Created November 29, 2012 03:28
vimrc config
let mapleader = ","
"--------------------------------------------------------
"" highline current line & column
" DOES NOT WORK with colorscheme solarized and blackboard
" "--------------------------------------------------------
set cursorline
set cursorcolumn
highlight cursorline term=underline cterm=underline ctermbg=0 gui=NONE guibg=Grey40
if has("autocmd")
" current line
# 0. Make sure you have Ruby 1.9.3 installed, and optionally RVM and PostgreSQL
# 0.2 If you are on the Mac, make sure you have a c compiler by installing XCode Command Line Tools or gcc4.2 with homebrew
# https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
# 0.5 Make sure you have bundler version ~> 1.2 as Rails depends on it
gem install bundler
# 1. Get edge Rails source (master branch)
git clone https://github.com/rails/rails.git
@zires
zires / How do I edit an existing buffer in a new tab in vim?
Created January 30, 2013 06:21
How do I edit an existing buffer in a new tab in vim?
When you start vim like that, you don't get a vim client, the text editor is using the terminal or cmd prompt - the two files are in two different buffers. Use :ls to list the buffers:
:ls
1 %a "foo" line 6
2 "bar" line 0
The %a is the active buffer. You can use :b2 to switch to buffer 2 or use :bn to cycle to the next or :bp for previous. I prefer (CTRL-W v) to split windows vertically, rather than (CTRL-W s), which splits horizontally.
If you have 2 files loaded & no tabs (yet), you can, :tabnew and in the new tab type :b2
If you want to always have buffers loaded into their own tabs, check out this article.
color molokai
nmap <F8> :TagbarToggle<CR>
" ctrl + s save current file
imap <C-s> <Esc>:w<CR>:echo expand("%f") . " saved."<CR>
vmap <C-s> <Esc>:w<CR>:echo expand("%f") . " saved."<CR>
nmap <C-s> <Esc>:w<CR>:echo expand("%f") . " saved."<CR>
" alt + q quit current buffer
imap <A-q> <Esc>:q<CR>