This file contains 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 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') |
This file contains 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 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) |
This file contains 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
//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); |
This file contains 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
pt-BR: | |
views: | |
admin: | |
home: | |
name: Home | |
pagination: | |
previous: "« Anterior" | |
next: "Próximo »" | |
truncate: "…" | |
misc: |
This file contains 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
=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') |
This file contains 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
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 | |
} |
This file contains 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
module ApplicationHelper | |
# Renders the first field error of an object attribute on a red alert. | |
# | |
# @param klass [Class Object] - This object needs to | |
# include ActiveModel::Validations (or be a normal ActiveModel) | |
# @param field_sym [Symbol] - Attribute or field name of the object | |
def show_error_message_for(klass, attribute) | |
if klass.errors[attribute].any? | |
%( |
This file contains 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
def simple_input_time_form(f, attribute_time, opts = {}) | |
default_opts = { | |
value_field: f.object.send(attribute_time), | |
attr_error: attribute_time, | |
format_time: :time, | |
icon_time: 'fa-clock-o', | |
col_size: 4 | |
} | |
opts = default_opts.merge(opts) | |
This file contains 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
set number | |
set tabstop=2 | |
set expandtab | |
# size of an indent | |
set shiftwidth=2 | |
# a combination of spaces and tabs are used to simulate tab stops at a width | |
# other than the (hard)tabstop | |
set softtabstop=2 |
This file contains 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
# test | |
describe '#initialize_delayed_recharge_process' do | |
subject { create :transport_service_recharge_batch } | |
let(:calculation_job) do | |
instance_double(RH::TransportRechargeBatchCalculationJob) | |
end | |
it 'calls DelayedJob#enqueue on RH::TransportRechargeBatchCalculationJob' do | |
expect(RH::TransportRechargeBatchCalculationJob).to receive(:new). |
OlderNewer