Skip to content

Instantly share code, notes, and snippets.

View waldofe's full-sized avatar
🦾

Oswaldo Ferreira waldofe

🦾
View GitHub Profile
@waldofe
waldofe / gist:9282553
Created March 1, 2014 00:04
Rspec failing tests rerun script
function zrun() {
SPEC_FILE=$1
SPEC_LOG=/tmp/rspec.log
if [ $SPEC_FILE ]; then
rspec $SPEC_FILE 2>&1 | tee $SPEC_LOG
else
cat $SPEC_LOG | grep "^rspec" | cut -d ' ' -f 2 | xargs rspec 2>&1 | tee $SPEC_LOG
fi
}
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
pt-BR:
views:
admin:
home:
name: Home
pagination:
previous: "« Anterior"
next: "Próximo »"
truncate: "…"
misc:
@waldofe
waldofe / gist:3746828
Created September 19, 2012 00:01 — forked from hudsonsferreira/gist:3710053
modelo de patch para inserir no Yakindu
//deve ser inserido no metodo createStatechartModel da classe FactoryUtils
//path: org.yakindu.sct.ui.editor/src/org/yakindu/sct/ui/editor/factories/FactoryUtils.java
State myState = SGraphFactory.eINSTANCE.createState();
myState.setName("Hudson");
region.getVertices().add(myState);
Node myStateNode = ViewService.createNode(
getRegionCompartmentView(regionView), myState,
SemanticHints.STATE, preferencesHint);
@waldofe
waldofe / eisparser.py
Created September 13, 2012 18:44
A tool to parse eis pattern content from xml documents.
from elementtree import ElementTree as ET
from os.path import join, basename, dirname
from nltk.util import clean_html
from nltk.corpus.reader import PlaintextCorpusReader
import re
class EisParser(object):
def __init__(self, path):
self._name = basename(path)
@waldofe
waldofe / xmlns.py
Created September 12, 2012 00:25
Xmlns simple parser.
from elementtree import ElementTree as ET
class XmlnsParser(object):
def __init__(self, path):
self.path = path
def tags_and_texts(self):
self.tags_n_text = {}
file = open(self.path, 'r')