Skip to content

Instantly share code, notes, and snippets.

# Converts PDF file passed into script into PNG files. Requires Ghostscript to be installed.
# Based on https://github.com/DeadExecutive/pdf_to_png/blob/main/PDF_To_PNG.ps1
#
# To enable drag and drop files, create a desktop shortcut with this command:
# powershell.exe -noprofile -noexit -File "C:\Path\To\ConvertPDFToPNGs.ps1"
# Input PDF path as an argument
param (
[Parameter(ValueFromRemainingArguments=$true)]
$pdfPath
@bbbco
bbbco / Wordle_Words_with_Various_Characterstics.txt
Last active October 26, 2022 14:15
Five letter words with various characteristics #Wordle
# List of five letter words that were pulled from the *nix wordlist /usr/share/dict/words
042f5716442f8724a5ce9c5785a93e0bf66eef2137b1d1bdd098a43f89dfe83a9f6e71aa4b3919a4ef8d59ecc8cbce0c2629b36b6ad71e1834a506d8f4547f7120
@bbbco
bbbco / keybase.md
Created March 15, 2017 20:25
Keybase Announcement

Keybase proof

I hereby claim:

  • I am bbbco on github.
  • I am bdgoad (https://keybase.io/bdgoad) on keybase.
  • I have a public key ASCDJf4_be7ZK_S7SBNP0UvXUUDL8ag2p82iJJ9dM8ZB5wo

To claim this, I am signing this object:

@bbbco
bbbco / tables_po.rb
Last active January 4, 2016 02:19
A simple example gist of a theoretical SWD Page Object gem based on using dot notation object oriented hierarchy for mapping and accessing elements on a page.
class TablesPage < Selenium::Pages::Page
// Define url to visit and matchers
url "/tables"
url_matcher /tables/
// Creates a new Element object that is required (i.e. expects to be visible at page load)
required_element :header, :css => "h3"
// Can also define multiple elements. Not specifying requirement only means it is expected to be present
@bbbco
bbbco / config_vars.rb
Created January 15, 2014 23:18
Sample of SWD config
# $> URL=theinternet BROWSER=firefox rspec spec/
URL_CONFIG = {
"theinternet" => {
:url => "http://the-internet.herokuapp.com",
:type => "staging"
},
"elemental-selenium" => {
:url => "http://elemental-selenium.com",
:type => "production"
@bbbco
bbbco / test_benchmark_location_strategies.rb
Created January 10, 2014 05:24
Ruby Script comparing CSS to XPath location strategies
require 'rubygems'
require 'selenium-webdriver'
require 'benchmark'
require 'benchmark/ips'
require 'pry'
LOCATORS = {
:dues_header_id_and_class => {
:css => "#table2 thead .dues",
:xpath => "//table[@id='table2']//thead//*[@class='dues']"
@bbbco
bbbco / rpdb.py
Created November 20, 2013 17:53
Robot Framework Python Debugger based on Daniel Cohn's recipe at http://code.activestate.com/recipes/578073-rpdb-robotpythondebugger-a-smarter-way-to-debug-ro/ fixed and updated for Python 2.7 / Robot Framework 2.8.x by Brian Goad. Allows you to jump into the code and debug your custom Python keywords. Wraps pdb because Robot Framework steals th…
import pdb
import sys
IO = lambda s: (s.__stdin__, s.__stdout__)
def rpdb(F):
"""
Robot Framework Python Debugger based on Daniel Cohn's recipe at
http://code.activestate.com/recipes/578073-rpdb-robotpythondebugger-a-smarter-way-to-debug-ro/
@bbbco
bbbco / $DEBUG.log
Created September 5, 2013 20:31
Since upgrading to Selenium WebDriver 2.35.1 I've been getting intermittent core dump when my tests complete. Here is the debug info I have gathered.
Finished in 2200.68985s
30 tests, 884 assertions, 0 failures, 1 errors, 1 skips
Writing XML reports to /cruisedata/jenkins-slave/workspace/SeleniumNewTests/selenium/rb/test/reports
I, [2013-09-05T14:50:08.677708 #1486] INFO : Killing browser
-> DELETE session/77fdaaf0-0631-4f10-851e-cbaed1098867
Exception `Errno::EAGAIN' at /home/site/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /home/site/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/protocol.rb:141 - Resource temporarily unavailable - read would block
<- {"name":"quit","sessionId":"77fdaaf0-0631-4f10-851e-cbaed1098867","status":0,"value":""}
#<ChildProcess::Unix::ForkExecProcess:0x0000000430e518 @args=["/usr/bin/firefox", "-no-remote", "-foreground"], @started=true, @exit_code=nil, @io=#<ChildProcess::Unix::IO:0x0000000430e4a0 @stdout=#<IO:<STDOUT>>, @stderr=#<IO:<STDERR>>>, @cwd=nil, @detach=false, @duplex=false, @environment={}, @pid=2844> : ["polling 5
@bbbco
bbbco / Generic Highlight
Created July 16, 2013 14:37
Selenium WebDriver // Highlights the element object in a yellow border
driver.executeScript("arguments[0].setAttribute(arguments[1], arguments[2])", element, "style", "border: 2px solid yellow; color: yellow; font-weight: bold;")