Skip to content

Instantly share code, notes, and snippets.

@leth
leth / gist:3940766
Created October 23, 2012 18:51
Virtualbox differencing disks for Vagrant

Summary

  • Detach disk from VM
  • Clone VM (fast!)
  • Attach disk to new VM in 'multiattach' mode (On attaching, virtualbox creates a new differencing image tied to original disk)
  • ...
  • Profit!

Status/Notes

@leth
leth / enum.py
Created May 19, 2012 18:24
This is my enum. There are many like it, but this one is mine.
import inspect
class Instance(object):
"""docstring for Instance"""
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
class ValueInstance(object):
@leth
leth / gist:1142925
Created August 12, 2011 20:29
An example autoloader
<?php
function jelly_tests_autoload($classname)
{
$filename = __DIR__.'/tests/classes/'. strtolower(str_replace($classname, '_', '/'))).EXT;
if (file_exists($filename))
require_once $filename;
}
if (TRUE /* If testing is enabled */)
@leth
leth / index.php
Created April 21, 2011 14:52
How to use the Kohana framework as a library
<?php
$content = 'Hello World';
?>
<html>
<head>
<title>Demo page</title>
</head>
<body>
<?php echo $content; ?>