Skip to content

Instantly share code, notes, and snippets.

View dblume's full-sized avatar

David Blume dblume

View GitHub Profile
@dblume
dblume / acid_write_file.py
Last active September 25, 2015 08:29
Cross-platform nearly ACID file updates
import platform
import tempfile
import ntpath
import filelock # https://github.com/dmfrey/FileLock
# It's interesting to see what's different between Windows and Linux.
# On Windows, you can't rename to an existing file, and you can't
# use os.fdatasync().
# Also see: http://blog.gocept.com/2013/07/15/reliable-file-updates-with-python/
@dblume
dblume / menus.plugin.php
Created January 23, 2014 08:48
The version of system/plugins/menus/menus.plugin.php that I got today from Habari
<?php
/**
* Menus
*
* @property Vocabulary $vocabulary The Vocabulary object used to hold the menu
*
* @todo allow renaming/editing of menu items
* @todo style everything so it looks good
* @todo show description with name on post publish checkboxes
* @todo PHPDoc