Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
  • 10 commits
  • 16 files changed
  • 0 commit comments
  • 1 contributor
View
36 bash/bash_profile
@@ -1,34 +1,34 @@
-
# Functions to help us manage paths. Second argument is the name of the
# path variable to be modified (default: PATH)
pathremove () {
- local IFS=':'
- local NEWPATH
- local DIR
- local PATHVARIABLE=${2:-PATH}
- for DIR in ${!PATHVARIABLE} ; do
- if [ "$DIR" != "$1" ] ; then
- NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
- fi
- done
- export $PATHVARIABLE="$NEWPATH"
+ local IFS=':'
+ local NEWPATH
+ local DIR
+ local PATHVARIABLE=${2:-PATH}
+ for DIR in ${!PATHVARIABLE} ; do
+ if [ "$DIR" != "$1" ] ; then
+ NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
+ fi
+ done
+ export $PATHVARIABLE="$NEWPATH"
}
pathprepend () {
- pathremove $1 $2
- local PATHVARIABLE=${2:-PATH}
- export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
+ pathremove $1 $2
+ local PATHVARIABLE=${2:-PATH}
+ export $PATHVARIABLE="$1${!PATHVARIABLE:+:${!PATHVARIABLE}}"
}
pathappend () {
- pathremove $1 $2
- local PATHVARIABLE=${2:-PATH}
- export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
+ pathremove $1 $2
+ local PATHVARIABLE=${2:-PATH}
+ export $PATHVARIABLE="${!PATHVARIABLE:+${!PATHVARIABLE}:}$1"
}
# MacGPG
-pathappend /usr/local/bin
+#already defined in /etc/paths
+#pathappend /usr/local/bin
# MacPorts
pathprepend /opt/local/bin:/opt/local/sbin
View
7 bash/bashrc
@@ -118,7 +118,7 @@ alias mv='mv -i'
alias cp='cp -i'
# rvm
-[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
+[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# pythonbrew
if [ -f "$HOME/.pythonbrew/etc/bashrc" ] ; then
@@ -133,3 +133,8 @@ fi
# git-exec
#export GIT_EXEC_PATH="$HOME/apps/gitexec:$(git --exec-path)"
+# bash_completion
+if [ -f "/opt/local/etc/bash_completion.d/git" ] ; then
+ source /opt/local/etc/bash_completion.d/git
+fi
+
View
19 bin/colordump
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Usage: colordump
+# Dump 256 ansi colors to the terminal.
+
+printf "How each ANSI color is displayed on your terminal:\n\n"
+
+i=0
+row=0
+while [ $i -lt 255 ];
+do
+newrow=$(expr $i / 10)
+ test $newrow -ne $row && printf "\n"
+ row=$newrow
+ printf "\e[%dm %03d \e[0m" $i $i
+ i=$(expr $i + 1)
+done
+
+printf '\n\n e.g., "\\e[41mTEXT\\e[0m" '
+printf "\e[41m(for TEXT like this)\e[0m\n"
View
9 bin/ghmarkdown.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+HOME="/Users/erning"
+
+[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
+source $HOME/.pythonbrew/etc/bashrc
+
+exec "$HOME/bin/github-flavored-markdown.rb" $@
+
View
65 bin/github-flavored-markdown.rb
@@ -0,0 +1,65 @@
+#!/usr/bin/env ruby
+# @author Aaron Lampros
+#
+# Github-flavored markdown to HTML, in a command-line util.
+#
+# $ cat README.md | ./github-flavored-markdown.rb
+#
+# Notes:
+# You will need to install Pygments for syntax coloring
+# ```bash
+# $ sudo easy_install pygments
+# ```
+#
+# Install the gems `redcarpet` and `Pygments`
+#
+#
+require 'rubygems'
+require 'redcarpet'
+require 'Pygments'
+
+class HTMLwithPygments < Redcarpet::Render::XHTML
+ # def doc_header()
+ # puts Pygments.styles()
+ # monokai
+ # manni
+ # perldoc
+ # borland
+ # colorful
+ # default
+ # murphy
+ # vs
+ # trac
+ # tango
+ # fruity
+ # autumn
+ # bw
+ # emacs
+ # vim
+ # pastie
+ # friendly
+ # native
+ # '<style>' + Pygments.css('.highlight',:style => 'vs') + '</style>'
+ # end
+ def block_code(code, language)
+ Pygments.highlight(code, :lexer => language, :options => {:encoding => 'utf-8'})
+ end
+end
+
+
+def fromMarkdown(text)
+ # options = [:fenced_code => true, :generate_toc => true, :hard_wrap => true, :no_intraemphasis => true, :strikethrough => true ,:gh_blockcode => true, :autolink => true, :xhtml => true, :tables => true]
+ markdown = Redcarpet::Markdown.new(HTMLwithPygments,
+ :fenced_code_blocks => true,
+ :no_intra_emphasis => true,
+ :autolink => true,
+ :strikethrough => true,
+ :lax_html_blocks => true,
+ :superscript => true,
+ :hard_wrap => true,
+ :tables => true,
+ :xhtml => true)
+ markdown.render(text)
+end
+
+puts fromMarkdown(ARGF.read)
View
28 bin/tmx
@@ -0,0 +1,28 @@
+[ ! -z "$TMUX" ] && exit
+exist_session=`tmux ls 2> /dev/null | awk -F: '{print $1}'`
+number_of_session=`tmux ls 2> /dev/null | wc -l | awk '{print $1}'`
+
+if [ $number_of_session = "0" ]; then
+ if [ -z $1 ]; then
+ tmux new -s main
+ else
+ tmux new -s "$1"
+ fi
+else
+ if [ -z "$1" ]; then
+ if [ "$number_of_session" = "1" ]; then
+ tmux attach
+ exit
+ fi
+ echo "Which seesion to attach?"
+ echo "$exist_session"
+ else
+ for session in $exist_session; do
+ if [ "$1" = "$session" ]; then
+ tmux attach -t "$1"
+ exit
+ fi
+ done
+ tmux new -s "$1"
+ fi
+fi
View
12 tmux/Makefile
@@ -0,0 +1,12 @@
+
+default: clean install
+
+clean:
+ rm -f "$(HOME)/.tmux.conf"
+
+install:
+ @PWD=`pwd`
+ ln -s "$(PWD)/tmux.conf" "$(HOME)/.tmux.conf"
+
+.PHONY: clean install
+
View
33 tmux/tmux.conf
@@ -0,0 +1,33 @@
+
+# Set status bar
+set -g status-bg black
+set -g status-fg white
+set -g status-left '#[fg=green]#H'
+
+# Highlight active window
+set-window-option -g window-status-current-bg red
+
+# Set window notifications
+setw -g monitor-activity on
+set -g visual-activity on
+
+# use "v" and "s" to do vertical/horizontal splits, like vim
+bind s split-window -v
+bind v split-window -h
+
+# use the vim motion keys to move between panes
+bind h select-pane -L
+bind j select-pane -D
+bind k select-pane -U
+bind l select-pane -R
+
+# use vim motion keys while in copy mode
+setw -g mode-keys vi
+# use the vim resize keys.
+# the number at the end is how much the pane will be resized,
+# and 1 is fairly small -- you might want to tweak this.
+bind < resize-pane -L 1
+bind > resize-pane -R 1
+bind - resize-pane -D 1
+bind + resize-pane -U 1
+
View
21 vim/bundle/vcl-vim-plugin/README.md
@@ -0,0 +1,21 @@
+Vim VCL Highlighting
+====================
+
+by Elan Ruusamäe <glen@delfi.ee>
+
+improvements by Steven Merrill <steven.merrill@gmail.com>
+
+Introduction
+------------
+
+This plugin enables syntax highlighting for VCL (Varnish Configuration Language)
+files in the vim editor.
+
+The plugin is based on code from the PLD Linux distribution.
+
+Downloads
+---------
+
+Source code and downloads are available at <https://github.com/smerrill/vcl-vim-plugin>.
+
+
View
1 vim/bundle/vcl-vim-plugin/ftdetect/vcl.vim
@@ -0,0 +1 @@
+au BufRead,BufNewFile *.vcl set filetype=vcl
View
106 vim/bundle/vcl-vim-plugin/syntax/vcl.vim
@@ -0,0 +1,106 @@
+" Vim syntax file
+" Filename: vcl.vim
+" Language: Varnish configuation Language, http://www.varnish-cache.org/wiki/VCL
+" Maintainer: Elan Ruusamäe <glen@delfi.ee>
+" Version Info: $Revision: 1.7 $
+" Last Change: $Date: 2010/04/06 08:24:28 $ UTC
+
+" For version 5.x: Clear all syntax items
+" For version 6.x: Quit when a syntax file was already loaded
+if version < 600
+ syntax clear
+elseif exists("b:current_syntax")
+ finish
+endif
+
+" TODO
+" - sub ...
+" - backend/director/...
+" - acl ...
+" - error when invalid operator used in if (...)
+" - +=, = operators
+" - functions
+
+" Code Blocks
+" sub NAME {
+" backend NAME {
+" director NAME FLAGS {
+" acl NAME {
+"syn region vclCodeBlock start="\s*\<sub\|backend\|director\|acl\>" end="{"he=e-1 contains=vclCodeBlockName,vclFunctionName
+"syn match vclCodeBlockName "\<sub\|backend\|director\|acl\>" contained
+"syn match vclFunctionName "\h[[:alnum:]_:]*" contained
+"syn match vclFunctionName "\h\w*[^:]" contained
+"
+syn keyword vclOperator set call return error esi synthetic include remove unset
+" return modes
+syn keyword vclModes deliver pipe pass hash lookup discard fetch restart
+
+" C strings
+syn region vclString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=vclSpecial
+syn match vclSpecial display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
+syn match vclSpecialError "L\='\\[^'\"?\\abfnrtv]'"
+syn match vclSpecialCharacter "L\='\\['\"?\\abfnrtv]'"
+syn match vclSpecialCharacter display "L\='\\\o\{1,3}'"
+syn match vclSpecialCharacter display "'\\x\x\{1,2}'"
+syn match vclSpecialCharacter display "L'\\x\x\+'"
+
+syn keyword vclConditional if else elsif elseif
+
+" Numbers
+syn match vclNumbers display transparent "\<\d\|\.\d" contains=vclNumber,vclNumberTime
+syn match vclNumber display contained "\d\+"
+" set obj.ttl = 0s, 0m;
+syn match vclNumberTime display contained "\d\+[dhsm]"
+
+" client
+syn match vclOption /client\.\(ip\|identity\)/
+" server
+syn match vclOption /server\.\(ip\|port\)/
+" req
+syn match vclOption /req\.\(hash\|request\|url\|proto\|backend\.healthy\|backend\|grace\|xid\|restarts\)/
+" bereq
+syn match vclOption /bereq\.\(request\|url\|proto\|connect_timeout\|first_byte_timeout\|between_bytes_timeout\)/
+" beresp
+syn match vclOption /beresp\.\(proto\|status\|response\|cacheable\|ttl\|lastuse\|hits\|hash\|grace\|prefetch\|saintmode\)/
+" obj
+syn match vclOption /obj\.\(proto\|status\|response\|cacheable\|ttl\|lastuse\|hits\|hash\|grace\|prefetch\)/
+" resp
+syn match vclOption /resp\.\(proto\|status\|response\)/
+" common: http.HEADERNAME
+syn match vclOption /\(req\|bereq\|resp\|beresp\|obj\)\.http\.[A-Za-z][-_A-Za-z0-9]*/
+
+" Highlight the C block
+syn include @vclC syntax/c.vim
+unlet b:current_syntax
+
+" Mark block tags itself as comment
+syn region vclCBlock matchgroup=vclComment start=/C{/ end=/}C/ contains=@vclC keepend
+
+" Synthetic
+syn region vclSynthetic start=/{"/hs=s+2 end=/"}/he=e-2 contains=@vclHTML keepend
+
+" Allow html in synthetic
+syn include @vclHTML syntax/html.vim
+unlet b:current_syntax
+
+syn match vclComment '#.*'
+syn match vclComment "//.*"
+syn region vclComment start="/\*" end="\*/"
+
+syn sync ccomment vclComment
+
+hi link vclCodeBlock Function
+hi link vclComment Comment
+hi link vclStatement Statement
+hi link vclFunctionName Identifier
+hi link vclCodeBlockName Statement
+hi link vclSpecial SpecialChar
+hi link vclString String
+hi link vclConditional Conditional
+hi link vclSynthetic vclString
+hi link vclSpecialCharacter vclSpecialSpecial
+hi link vclOperator Operator
+hi link vclModes Operator
+hi link vclOption Identifier
+hi link vclNumber Number
+hi link vclNumberTime Number
View
5 vim/bundle/vim-octopress/README
@@ -0,0 +1,5 @@
+This is a mirror of http://www.vim.org/scripts/script.php?script_id=3835
+
+Syntax highlighting mode for Octopress-flavored markdown files (posts, pages mostly).
+
+Source is at https://github.com/tangledhelix/vim-octopress
View
26 vim/bundle/vim-octopress/README.md
@@ -0,0 +1,26 @@
+
+[Vim][] syntax highlighting for [Octopress][]-flavored Markdown files.
+
+[vim]: http://www.vim.org/
+[octopress]: http://octopress.org/
+
+To install the traditional way:
+
+ git clone https://github.com/tangledhelix/vim-octopress.git
+ cd vim-octopress
+ for i in ftplugin syntax ; do
+ mkdir -p ~/.vim/$i
+ cp $i/octopress.vim ~/.vim/$i
+ done
+
+If you use [Pathogen][]:
+
+[pathogen]: https://github.com/tpope/vim-pathogen
+
+ cd ~/.vim/bundle
+ git clone https://github.com/tangledhelix/vim-octopress.git octopress
+
+To use this mode for your Octopress Markdown files, use an `autocmd`.
+
+ autocmd BufNewFile,BufRead *.markdown setfiletype octopress
+
View
13 vim/bundle/vim-octopress/ftplugin/octopress.vim
@@ -0,0 +1,13 @@
+" Vim filetype plugin
+" Language: Markdown (Octopress variant with Liquid)
+" Maintainer: Dan Lowe (dan@tangledhelix.com)
+" Last Change: 2 Dec 2012
+" URL: https://github.com/tangledhelix/vim-octopress
+
+if exists('b:did_ftplugin')
+ finish
+endif
+
+runtime! ftplugin/markdown.vim
+unlet! b:did_ftplugin
+
View
47 vim/bundle/vim-octopress/syntax/octopress.vim
@@ -0,0 +1,47 @@
+" Vim syntax file
+" Language: Markdown (Octopress variant with Liquid)
+" Maintainer: Dan Lowe <dan@tangledhelix.com>
+" Last Change: 4 Dec 2012
+" URL: https://github.com/tangledhelix/vim-octopress
+
+if exists('b:current_syntax')
+ finish
+endif
+
+runtime! syntax/markdown.vim
+unlet! b:current_syntax
+
+" YAML front matter
+syn region octopressYamlFrontMatter start=/\m^---\s*$/ end=/\m^---\s*$/ contains=octopressYamlFrontMatterParam,octopressYamlFrontMatterValue
+syn match octopressYamlFrontMatterParam /\m^[^:]\+:/ contained nextgroup=octopressYamlFrontMatterValue
+syn match octopressYamlFrontMatterValue /\m\s.*$/ contained
+
+" Liquid tags
+syn match octopressLiquidTag /\m{%\s\+\(video\|include_code\|gist\|jsfiddle\|img\|render_partial\|include\)\s.*\s*%}/ oneline
+
+" Liquid blocks
+syn region octopressLiquidBlock matchgroup=octopressLiquidBlockDelimiter start=/\m{%\s\+\(codeblock\|blockquote\|pullquote\)\s.*\s*%}/ end=/\m{%\s\+end\(codeblock\|blockquote\|pullquote\)\s\+%}/ contains=octopressPullquote
+syn match octopressPullquote /\m{"\s[^{]\+\s"}/ contained oneline
+
+" Backtick block
+syn region octopressBacktickBlock matchgroup=octopressBacktickBlockDelimiter start=/\m^```\(\s*\|\s\+.*\)$/ end=/\m^```\s*$/
+
+command -nargs=+ HiLink hi def link <args>
+
+HiLink octopressYamlFrontMatter PreProc
+HiLink octopressYamlFrontMatterParam Identifier
+HiLink octopressYamlFrontMatterValue String
+
+HiLink octopressLiquidTag PreProc
+
+HiLink octopressLiquidBlockDelimiter PreProc
+HiLink octopressLiquidBlock Underlined
+HiLink octopressPullquote PreProc
+
+HiLink octopressBacktickBlockDelimiter PreProc
+HiLink octopressBacktickBlock Underlined
+
+delcommand HiLink
+
+let b:current_syntax = 'octopress'
+
View
18 vim/vimrc
@@ -48,6 +48,24 @@ set smarttab
" makefiles always use tab
autocmd FileType make setlocal noexpandtab
+" strip trailing whitespace
+function! <SID>StripTrailingWhitespaces()
+ " Preparation: save last search, and cursor position.
+ let _s=@/
+ let l = line(".")
+ let c = col(".")
+ " Do the business:
+ %s/\s\+$//e
+ " Clean up: restore previous search history, and cursor position
+ let @/=_s
+ call cursor(l, c)
+endfunction
+
+nnoremap <leader>s :call <SID>StripTrailingWhitespaces()<CR>
+autocmd BufWritePre *.py,*.js,*.css :call <SID>StripTrailingWhitespaces()
+autocmd BufWritePre *.php :call <SID>StripTrailingWhitespaces()
+
+
" indent
set autoindent
set smartindent

No commit comments for this range

Something went wrong with that request. Please try again.