This file contains hidden or 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
#!/bin/bash | |
# | |
# tc uses the following units when passed as a parameter. | |
# kbps: Kilobytes per second | |
# mbps: Megabytes per second | |
# kbit: Kilobits per second | |
# mbit: Megabits per second | |
# bps: Bytes per second | |
# Amounts of data can be specified in: | |
# kb or k: Kilobytes |
This file contains hidden or 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
from pygments.lexer import RegexLexer, bygroups | |
from pygments.token import Text, Name, Generic, Whitespace, Operator | |
class FabLexer(RegexLexer): | |
name = 'FAB' | |
aliases = ['fab', 'fabric'] | |
filenames = ['*.txt', '*.log'] | |
tokens = { | |
'root': [ |
This file contains hidden or 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
from zope.component import getGlobalSiteManager, adapts | |
from zope.interface import Interface, implements | |
class IApple(Interface): | |
"""I'm an apple""" | |
class Apple: | |
implements(IApple) # we need this so we can adapt this class | |
worm = "~~~" |
This file contains hidden or 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
from zope.component import getGlobalSiteManager | |
from zope.interface import Interface, implements | |
#It's is common practice to prefix interfaces with a big "i". | |
class ISpeach(Interface): | |
def say(text): | |
"""Say something""" | |
class Hello: # Our utility | |
#I promise that I implement ISpeach interface. |
This file contains hidden or 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 Apple: | |
worm = "~~~" | |
class Orange: | |
def slices(self): | |
return [1, 2, 3] | |
def get_slices(basket): | |
"""For each item in the basket get it's slices""" | |
slices = [] |
This file contains hidden or 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 Apple: | |
worm = "~~~" | |
class Orange: | |
def slices(self): | |
return [1, 2, 3] | |
def get_slices(basket): | |
"""For each item in the basket get it's slices""" | |
slices = [] |
This file contains hidden or 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
#!/usr/bin/python | |
import os | |
import memcache | |
import time | |
from pprint import pprint | |
client = memcache.Client(["127.0.0.1:11211"]) | |
while True: | |
os.system('clear') |
This file contains hidden or 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
Assertions: | |
- I'm not stupid | |
- I don't want to be limited by some idiotic `people that write templates are stupid` rule. | |
- I don't want to learn yet another template language. | |
- I want to use golang expressions if, for.. | |
- I want all the power of indexing, getting attributes and performing operations that golang offers. | |
- I want to type less stuff and do more. | |
- I want to include other templates in my template. (jinja?) | |
- I want to extend templates. |
This file contains hidden or 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
[user] | |
name = Alexandru Plugaru | |
email = [email protected] | |
[color] | |
ui = auto | |
[diff] | |
guitool = diffuse | |
[alias] | |
ci = commit --verbose | |
cam = commit -a --amend |
This file contains hidden or 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
#!/usr/bin/env python | |
import os | |
from lxml import etree | |
from multiprocessing import Process, Queue | |
import simplejson as json | |
import cPickle | |
import math | |
############### | |
# # |