Skip to content

Instantly share code, notes, and snippets.

class PageObject
attr_reader :object_type, :name, :find_by
def initialize(object_type, name, find_by)
@object_type = object_type
@name = name
@find_by = find_by
end
end
class PageObjectLooker
require 'rexml/document'
PLUGIN_PATH = 'project/build/plugins/plugin'
ARTIFACT_PATH = 'artifactId'
COMPILER_NAME = 'maven-compiler-plugin'
NEW_PLUGIN = "<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
require 'rexml/document'
SELENIUM_PATH = 'project/properties/selenium.version'
SELENIUM_VERSION = "2\.48\.2"
def get_file_list(dir)
Dir.glob("#{dir}/**/pom.xml")
end
def get_xml(pom)
@dmcnulla
dmcnulla / 0_reuse_code.js
Created February 23, 2016 21:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
require 'webrick'
require 'json'
include WEBrick
def start_webrick(config = {})
config.update(:Port => 9001)
server = HTTPServer.new(config)
yield server if block_given?
['INT', 'TERM'].each {|signal|
MAP = {
'0' => '0000',
'1' => '0001',
'2' => '0010',
'3' => '0011',
'4' => '0100',
'5' => '0101',
'6' => '0110',
'7' => '0111',
'8' => '1000',
@dmcnulla
dmcnulla / .ackrc
Last active February 26, 2021 17:51
My ack-grep search helper file.
# only search with case sensitivity if there is mixed case
--smart-case
# Sort the files
--sort-files
--type-set=web=.css,.htm,.html,.php,.phtml,.js
--type-set=py=.py
--type-set=ruby=.rb,.rhtml,.rjs,.rxml,.erb,.rake,Rakefile
--type-set=steps=steps.rb,steps.java
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/dm186069/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
@dmcnulla
dmcnulla / .profile
Created May 13, 2017 05:16
bash profile
# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
# aliases added by dmcnculla
alias s='subl '
alias tj='tar -xvjpf'
alias t='tar xvfz '
alias tz='tar -xvzpf'
@dmcnulla
dmcnulla / convert.py
Created May 6, 2021 00:16
Converts postman output file to http format (http service in IntelliJ)
import json
from os import listdir
BASE_PATH = '.'
if __name__ == '__main__':
for file in [f"{BASE_PATH}/{file_name}" for file_name in listdir(BASE_PATH) if file_name.endswith('.json')]:
with open(file) as json_file:
data = json.load(json_file)
items = data['item']