This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yaml | |
import yaml.constructor | |
############################################################### | |
# Procedures to preserve order of config file for readability # | |
############################################################### | |
# http://stackoverflow.com/questions/5121931/in-python-how-can-you-load-yaml-mappings-as-ordereddicts | |
try: | |
# included in standard lib from Python 2.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class picklize: | |
""" | |
Turn a function into an object-function that will | |
check to see if the result of your function is on | |
disk. The name comes from the similarity to memoization: | |
http://stackoverflow.com/questions/1988804/what-is-memoization-and-how-can-i-use-it-in-python | |
Example: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fastentries | |
iterator fastaEntries*(fname: string) : tuple[name,s:string] = | |
for entryInfo in entriesMapped(fname, sep=int('>')): | |
let seqInfo = entryInfo.skipToChar(10) | |
let s = seqInfo.toGCString(skipNewline=true, upper=true) | |
var nameInfo : TEntry = (entryInfo.start, seqInfo.start - entryInfo.start) | |
let name = nameInfo.toGCString | |
yield (name, s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Your keymap | |
# | |
# Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors | |
# to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# | |
# Here's an example taken from Atom's built-in keymap: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
killall -9 sshfs | |
umount mydir | |
sshfs user@host:path -oauto_cache,reconnect,volname=mydir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = | |
activate: -> | |
atom.workspaceView.command "wrap-lines:wrap", => @wrap() | |
atom.workspaceView.command "wrap-lines:unwrap", => @unwrap() | |
wrap: -> | |
editor = atom.workspace.activePaneItem | |
selection = editor.getSelection() | |
stext = selection.getText() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import memfiles, strutils | |
proc firstChar*(s: pointer; c,n: int) : pointer {.importc: "memchr", | |
header: "<string.h>"} | |
type TEntry* = tuple[start: TAddress, numChars: int] | |
proc skipToChar*(e:TEntry, c: int): TEntry = | |
let caddr = cast[TAddress](firstChar(cast[pointer](e.start), c, e.numChars)) | |
if caddr > 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Your Stylesheet | |
* | |
* This stylesheet is loaded when Atom starts up and is reloaded automatically | |
* when it is changed. | |
* | |
* If you are unfamiliar with LESS, you can read more about it here: | |
* http://www.lesscss.org | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" vim +BundleInstall! +BundleClean +qall | |
" ,,w smart jumping! | |
set nofoldenable | |
Bundle 'zah/nimrod.vim' | |
colorscheme peaksea | |
UnBundle 'AutoClose' | |
UnBundle 'spf13/vim-autoclose' | |
"set mouse=c " Disable cursor positioning by mouse | |
execute "set colorcolumn=" . join(range(81,335), ',') | |
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
proc shell*(cmd: string) = | |
if os.execShellCmd(cmd) != 0: | |
raise newException(EOS, cmd & " returned error code 1") | |
proc fexists*(fname: string) : bool = | |
try: discard Open(fname) | |
except EIO: return false | |
return true |