• Does Mac OS X have an equivalent to /dev/shm?

    March 19, 2016
    You can create and mount a ram based disk as follows: Create a disk: $ hdiutil attach -nomount ram://$((2 * 1024 * SIZE_IN_MB)) hdiutil will return the name of the ramdisk. Format and mount the disk diskutil eraseVolume HFS+ RAMDisk NAME_OF_DISK Creating a 100MB ramdisk: $ hdiutil attach -nomount ram://$((2 * 1024 * 100)) /dev/disk3 […]
  • VIM: Substituting in a visual selection

    March 17, 2016
    The substitute command (:s) applies to whole lines, however the \%V atom will restrict a pattern so that it matches only inside the visual selection. This works with characterwise and blockwise selection (and is not needed with linewise selection). For example, put the cursor on this line: music amuse fuse refuse In normal mode, type […]