Skip to content

Instantly share code, notes, and snippets.

View jacob-ogre's full-sized avatar

Jacob Malcom jacob-ogre

View GitHub Profile
@jacob-ogre
jacob-ogre / r_readtable.snippet
Last active December 17, 2015 14:49
Vim snippet for R's read.table function.
snippet read
${1:name} <- read.table("${2:path/to/file}",
sep="${3:\t ,}",
header=${4:T F})
@jacob-ogre
jacob-ogre / r_commentblock.snippet
Last active December 17, 2015 14:59
R: comment_block A vim-snippets for a 79-col comment block, which I use to delineate sections of scripts.
snippet combl
###########################################################################
# ${1:Comment text}
###########################################################################
${2}
@jacob-ogre
jacob-ogre / iflen.snippet
Last active December 17, 2015 14:59
Python: if len(sys.argv) != N A vim-snippet for exiting if the number of command-line arguments is incorrect.
snippet iflen
if len(sys.argv) != ${1:N}:
print main.__doc__
sys.exit()
${2}
<snippet>
<content><![CDATA[
from ${1:module} import ${2:sub} as ${3}
]]></content>
<tabTrigger>from</tabTrigger>
<scope>source.python</scope>
<description>from_import_as</description>
</snippet>
alias ll='ls -la'
alias ld='ll | grep '^d''
alias tmkill='tmux kill-session'
alias tmux='TERM=xterm-256color tmux'
alias lonestar='ssh username@lonestar.tacc.utexas.edu'
alias stampede='ssh username@stampede.tacc.utexas.edu'
export TERM=xterm-256color
export GOROOT=$HOME/go
new
split-window -h -p 50 -t 0
split-window -v -p 30 -t 1
# pane number display
set-window-option -g window-status-current-bg yellow
# keybindings
set-window-option -g mode-keys vi
@jacob-ogre
jacob-ogre / NerdTreeClose.py
Created June 12, 2013 21:47
Close the pseudo-NerdTree and return focus in Sublime Text 2
import sublime, sublime_plugin
class NerdTreeCloseCommand(sublime_plugin.WindowCommand):
def run(self):
self.window.run_command("focus_group", {"group": 0} )
self.window.run_command("toggle_side_bar")
@jacob-ogre
jacob-ogre / Short_Docstring.sublime-snippet
Created June 14, 2013 23:49
Python: One-liner Python docstring Sublime Text snippet
<snippet>
<content><![CDATA[
"""${1:One-liner docstring}"""]]></content>
<tabTrigger>docs</tabTrigger>
<scope>source.python</scope>
<description>Short Docstring</description>
</snippet>
@jacob-ogre
jacob-ogre / Long_Docstring.sublime-snippet
Created June 14, 2013 23:47
Python: Long docstring
<snippet>
<content><![CDATA[
"""
${1:One-liner}
USAGE:
python ${2:file} ${3:args...}
ARGS:
${4:arg, explanation}
RETURNS:
@jacob-ogre
jacob-ogre / with_open_out.sublime-snippet
Created June 19, 2013 18:47
Python:Write file using with_open_as_out syntax
<snippet>
<content><![CDATA[
with open(${1:fil}, 'wb') as ${2:out}:
${3:code}
]]></content>
<tabTrigger>write</tabTrigger>
<scope>source.python</scope>
<description>WithOpenOut</description>
</snippet>