Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
class Transaction(object): | |
def __init__(self, db): | |
self.db = db | |
def __enter__(self): | |
return self.db.session | |
def __exit__(self, type, value, traceback): |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
#!/usr/bin/env python | |
""" | |
Example fabfile for PyMNtos September 2011 meeting. | |
some examples of usage: | |
$ fab -H somehost -- uname -a | |
$ fab -H somehost run:'uname -a' | |
$ fab -d example |
/(\<(?:.*?)\>)([^\<]*)/gm |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="author" content="Sergej Müller" /> | |
<link href="style.css" rel="stylesheet" /> | |
<title>Fullscreen Demo</title> |
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications
like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
class BankAccount < ActiveRecord::Base | |
# Umsätze von start_date bis end_date abrufen | |
# * passport_type, passphrase, pin und file kommen in dieser Implementation aus der zugrunde liegenden Tabelle. | |
# * Wenn passport_type = "PinTan" ist, wird die pin verwendet. | |
# * Wenn passport_type = "RDHNew" ist, wird die Schlüsseldatei aus filename verwendet und mit der passphrase entschlüsselt. | |
def get_transactions(start_date, end_date) | |
HBCIUtils.setParam("client.passport.#{passport_type}.filename", filename) | |
HBCIUtils.setParam("client.passport.#{passport_type}.init", '1') | |
(Inspired by http://yourmacguy.wordpress.com/2012/06/29/osx-automount/)
/home/vagrant
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> | |
<T3DataStructure> | |
<ROOT type="array"> | |
<type>array</type> | |
<el type="array"> | |
<headline type="array"> | |
<TCEforms type="array"> | |
<label>Überschrift</label> | |
<config type="array"> | |
<type>input</type> |