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
#!/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
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
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
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 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
#!/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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Using google geocoding API try to fix addresses in capsule | |
""" | |
import sys | |
import argparse | |
import requests |
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
brew install autoconf automake brew-cask freetype gdbm gettext git-sh gnu-getopt gnupg2 gpg-agent gradle imagemagick jpeg lame libassuan libevent libgcrypt libgpg-error libksba libpng libtool libusb libusb-compat mad memtester node openssl ossp-uuid pass pcre pinentry pkg-config postgresql pth pwgen python readline sox sqlite the_silver_searcher tmux tree | |
brew cask install f-lux google-drive libreoffice pgadmin3 seashore spectacle webstorm android-file-transfer firefox gimp iterm2 macvim pycharm clipmenu font-dejavu google-chrome keyremap4macbook menumeters rdio sketch unrarx | |