Skip to content

Instantly share code, notes, and snippets.

View gabrielfalcao's full-sized avatar

Gabriel Falcão gabrielfalcao

View GitHub Profile
@gabrielfalcao
gabrielfalcao / README.md
Created June 3, 2011 19:44
Homebrew formula for nginx with the tcp socket proxy module already enabled
python setup.py install --with-xml2-config=/usr/local/Cellar/libxml2/2.7.8/bin/xml2-config
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from subprocess import Popen
output = open("tal.txt", "w")
p = Popen(['ls'], stdout=output)
output.close()
Cleaning up files that are already in .gitignore... OK!
Running unit tests ...
nose.plugins.cover: ERROR: Coverage not available: unable to import coverage module
Step definition takes a function and a step, keeps its definition relative path, and line + 1 (to consider the decorator) ... ok
Step description takes a line and filename, and keeps the relative path for filename ... ok
Scenario description takes a scenario, filename and a string, and keeps the relative path for filename and line ... ok
Feature description takes a feature, filename and original string, and keeps the relative path for filename, line and description lines ... ok
Step.represent_string behaviour when not defined ... ok
Step.represent_string behaviour when defined ... ok
Step.represent_hashes ... ok
@gabrielfalcao
gabrielfalcao / gist:1508140
Created December 21, 2011 23:11
Sample lettuce feature
Feature: exemplify why step.behave_as can be a not-so-good option
Scenario: Login should work
Given I am at the login page
When I type the username "root"
And I type the password "123"
And I try to perform the login
Then it works and I am redirected to the admin page
Scenario: Get in the user management admin page
@gabrielfalcao
gabrielfalcao / gist:1508156
Created December 21, 2011 23:17
sample lettuce step definitions
from lettuce import *
from lettuce.django import django_url
from splinter.browser import Browser
PAGES = {
"the login page": "/login",
"the user management page": "/manage/users"
}
def page_name_is_valid(name):
from lettuce import *
from lettuce.django import django_url
from splinter.browser import Browser
PAGES = {
"the login page": "/login",
"the user management page": "/manage/users"
}
def page_name_is_valid(name):
Starting speed tests...
object loop: 36ms
~ 27778 renders per sec.
array loop: 23ms
~ 43478 renders per sec.
Compile one template 1000 times: 3ms
~ 333333 renders per sec.
Render 1000 Includes Templates: 31ms
~ 32258 renders per sec.
Starting speed tests...
object loop: 35ms
~ 28571 renders per sec.
array loop: 26ms
~ 38462 renders per sec.
Compile one template 1000 times: 2ms
~ 500000 renders per sec.
Render 1000 Includes Templates: 33ms
~ 30303 renders per sec.
@gabrielfalcao
gabrielfalcao / .gitignore
Created February 1, 2012 04:05
Creates to do lists on Basecamp
*.pyc