Skip to content

Instantly share code, notes, and snippets.

@FelixHartmann
FelixHartmann / traits_saving_in_json.py
Created September 16, 2013 15:50
Saving and loading Traits in a JSON file using the json Python module.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Saving and loading Traits in a JSON file using the json Python module.
This example shows how to save Traits of an object with nested objects, and load
these Traits. In addition, we want to ignore some given nested objects in the
saving/loading process.
Based on a previous example by Pierre Haessig:
@m3nd3s
m3nd3s / NERDTree.mkd
Last active November 23, 2023 13:45
My Vim Cheat Sheet

NERDTree

o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

@jordanorelli
jordanorelli / open_editor.py
Created June 9, 2011 21:15
A Python script to open a temporary file in the user's editor, echo its contents, and delete the file.
# Jordan Orelli wrote it.
# Do what you want with it.
# June 9th, 2011
import os
import subprocess
import tempfile
if not os.environ.has_key('EDITOR'):
raise Exception('Unable to open editor; please set your EDITOR '