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
Scenario: Some determinable business situation | |
Given some precondition | |
And some other precondition | |
When some action by the actor | |
And some other action | |
And yet another action | |
Then some testable outcome is achieved | |
And something else we can check happens too |
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
# Creates a virtual machine and builds the EDK2 source | |
# VirtualBox and Vagrant must be installed first | |
vagrant box add base http://files.vagrantup.com/precise64.box | |
vagrant init | |
vagrant up | |
vagrant ssh | |
sudo apt-get update | |
sudo apt-get install build-essential git uuid-dev iasl | |
git clone https://github.com/curzona/edk2.git |
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
dict(zip(d.values(), d.keys())) |
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 Struct: | |
def __init__(self, **entries): | |
for k, v in entries.items(): | |
if isinstance(v, dict): | |
entries[k] = Struct(**v) | |
self.__dict__.update(entries) | |
d = {'a':{'b':1, 'c':2}, 'd':1} | |
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 sys | |
import time | |
import logging | |
class Logger(logging.Logger): | |
indent = 0 | |
def __init__(self, name, level=logging.NOTSET): | |
logging.Logger.__init__(self, name, level) | |
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 sys | |
import socket | |
from threading import Thread | |
if sys.version_info >= (3,0): | |
from xmlrpc.server import SimpleXMLRPCServer | |
from xmlrpc.client import ServerProxy | |
else: | |
from SimpleXMLRPCServer import SimpleXMLRPCServer | |
from xmlrpclib import ServerProxy |
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 ConfigParser | |
def parser_config(filename): | |
dict = {} | |
config = ConfigParser.ConfigParser() | |
config.optionxform = str | |
config.read(filename) | |
for section in config.sections(): |
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 sys | |
import time | |
import logging | |
class Logger(logging.Logger): | |
indent = 0 | |
def __init__(self, name, level=logging.NOTSET): | |
logging.Logger.__init__(self, name, level) | |
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 sys | |
import types | |
castor = {types.IntType:int, types.LongType:long, types.FloatType:float, types.BooleanType:bool} | |
def ask(message, default): | |
sys.stdout.write(message + " [" + str(default) + "]:") | |
input = sys.stdin.readline().strip() | |
if input == "": |
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 sys | |
from optparse import OptionParser | |
def command(options, args): | |
function, parameters = args[0], args[1:] | |
print "You typed: {0}({1})".format(function, parameters) | |
def interactive(options, args): | |
print "Python interactive window. Type $help for a list of commands." |
OlderNewer