Skip to content

Instantly share code, notes, and snippets.

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|
@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 '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)
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>
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