Skip to content

Instantly share code, notes, and snippets.

@tazjel
tazjel / exception.txt
Created June 3, 2012 04:59 — forked from basepi/exception.txt
Python Regex Question
Traceback (most recent call last):
File "/usr/local/bin/../Cellar/python3/3.2.2/lib/python3.2/functools.py", line 176, in wrapper
result = cache[key]
KeyError: (<class 'str'>, '(^.*def\\W*)(\\w+)\\W*\\((.*)?\\):', 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./pickout_fn_defs.py", line 25, in <module>
FnDefRe = re.compile(r'(^.*def\W*)(\w+)\W*\((.*)?\):')
@tazjel
tazjel / TrackRegexRetweeter.py
Created June 3, 2012 05:03 — forked from ayman/TrackRegexRetweeter.py
This is a simple Twitter bot which listens to a track stream for a comma delimited list of terms/tags (PRIMARY_TRACK_LIST). From this stream, it will retweet any tweet that matches the secondary regex (SECONDARY_REGEX_FILTER).
#!/usr/bin/env python
# This is a simple Twitter bot which listens to a track stream for a comma delimited
# list of terms/tags (PRIMARY_TRACK_LIST). From this stream, it will retweet any
# tweet that matches the secondary regex (SECONDARY_REGEX_FILTER).
#
# This example is a #Haiti & #Chile Twitter stream listener for TweakTheTweet syntax.
#
# Requires Python 2.6
# Requires Tweepy http://github.com/joshthecoder/tweepy
#
@tazjel
tazjel / treebase_metadata.py
Created June 22, 2012 16:04 — forked from DASpringate/treebase_metadata.py
Extracts organism metadata for taxa in treebase repo from GenomesOnline via ncbi
#!/usr/bin/python2
# Quick and dirty web scraper for extracting html files of
# Organism information, Genome Project Information,
# Sequencing Information, Environmental Metadata
# and organism metadata
# from GOLD databases based on treebase taxa lists, via ncbi
# Saves pages in the current directory
from urllib2 import urlopen

Initial setup for ubuntu server

Update and Upgrade

sudo aptitude update && sudo aptitude safe-upgrade

User Setup

Create new user:

%s/\C\<g:NeoComplCache_EnableAtStartup\>/g:neocomplcache_enable_at_startup/ge
%s/\C\<g:NeoComplCache_MaxList\>/g:neocomplcache_max_list/ge
%s/\C\<g:NeoComplCache_MaxKeywordWidth\>/g:neocomplcache_max_keyword_width/ge
%s/\C\<g:NeoComplCache_MaxFilenameWidth\>/g:neocomplcache_max_filename_width/ge
%s/\C\<g:NeoComplCache_KeywordCompletionStartLength\>/g:neocomplcache_auto_completion_start_length/ge
%s/\C\<g:NeoComplCache_ManualCompletionStartLength\>/g:neocomplcache_manual_completion_start_length/ge
%s/\C\<g:NeoComplCache_MinKeywordLength\>/g:neocomplcache_min_keyword_length/ge
%s/\C\<g:NeoComplCache_MinSyntaxLength\>/g:neocomplcache_min_syntax_length/ge
%s/\C\<g:NeoComplCache_IgnoreCase\>/g:neocomplcache_enable_ignore_case/ge
%s/\C\<g:NeoComplCache_SmartCase\>/g:neocomplcache_enable_smart_case/ge
%s/\C\<g:NeoComplCache_EnableAtStartup\>/g:neocomplcache_enable_at_startup/ge
%s/\C\<g:NeoComplCache_MaxList\>/g:neocomplcache_max_list/ge
%s/\C\<g:NeoComplCache_MaxKeywordWidth\>/g:neocomplcache_max_keyword_width/ge
%s/\C\<g:NeoComplCache_MaxFilenameWidth\>/g:neocomplcache_max_filename_width/ge
%s/\C\<g:NeoComplCache_KeywordCompletionStartLength\>/g:neocomplcache_auto_completion_start_length/ge
%s/\C\<g:NeoComplCache_ManualCompletionStartLength\>/g:neocomplcache_manual_completion_start_length/ge
%s/\C\<g:NeoComplCache_MinKeywordLength\>/g:neocomplcache_min_keyword_length/ge
%s/\C\<g:NeoComplCache_MinSyntaxLength\>/g:neocomplcache_min_syntax_length/ge
%s/\C\<g:NeoComplCache_IgnoreCase\>/g:neocomplcache_enable_ignore_case/ge
%s/\C\<g:NeoComplCache_SmartCase\>/g:neocomplcache_enable_smart_case/ge
function! MarkdownFolds()
let thisline = getline(v:lnum)
if match(thisline, '^##') >= 0
return ">2"
elseif match(thisline, '^#') >= 0
return ">1"
else
return "="
endif
endfunction
@tazjel
tazjel / markdown.vim
Created January 27, 2013 21:35 — forked from sjl/markdown.vim
" folding for Markdown headers, both styles (atx- and setex-)
" http://daringfireball.net/projects/markdown/syntax#header
"
" this code can be placed in file
" $HOME/.vim/after/ftplugin/markdown.vim
func! Foldexpr_markdown(lnum)
let l1 = getline(a:lnum)
if l1 =~ '^\s*$'
# Shows little symbol '±' if you're currently at a git repo and '○' all other times
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
echo '○'
}
PROMPT='
%{$fg[blue]%}%n%{$reset_color%} on %{$fg[yellow]%}%m%{$reset_color%} in %{$fg[green]%}%~%b%{$reset_color%} $(git_time_since_commit)$(check_git_prompt_info)
${vcs_info_msg_0_}$(prompt_char) '
# Shows little symbol '±' if you're currently at a git repo and '○' all other times
function prompt_char {
git branch >/dev/null 2>/dev/null && echo '±' && return
echo '○'
}
PROMPT='
%{$fg[blue]%}%n%{$reset_color%} on %{$fg[yellow]%}%m%{$reset_color%} in %{$fg[green]%}%~%b%{$reset_color%} $(git_time_since_commit)$(check_git_prompt_info)
${vcs_info_msg_0_}$(prompt_char) '