-
Open a browser
# start an instance of firefox with selenium-webdriver $browser_type = 'firefox' $host = 'http://localhost:4444/wd/hub'
$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);
| /* | |
| Copyright (c) 2015-2025 Alessandro Diaferia | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
| /** | |
| * Set and stringify local storage item(s) | |
| * | |
| * @param {(string|object)} key | |
| * @param {*} value | |
| */ | |
| window.setStorage = function(key, value) { | |
| if (_.isObject(key)) { | |
| _.each(key, function(value, key) { | |
| localStorage.setItem(key, JSON.stringify(value)); |
| //Set Variables | |
| $button-white: #ffffff; | |
| $button-green: #44ca00; | |
| $button-green-dark: #369a12; | |
| $button-blue: #a6d1f9; | |
| $button-blue-dark: #14283e; | |
| $button-gray: #eeeeee; | |
| $button-red: #9e0b0f; | |
| //Create Array |
I needed a newer version of ImageMagick than is available on the yum packages on Amazon Linux. I tried using the remi repo but it failed with dependency errors. Here is what I did to install ImageMagick with support for PNG, JPG, and TIFF.
download the most recent package
wget http://www.imagemagick.org/download/ImageMagick.tar.gz
uncomress the package
| [ | |
| {name: 'Afghanistan', code: 'AF'}, | |
| {name: 'Åland Islands', code: 'AX'}, | |
| {name: 'Albania', code: 'AL'}, | |
| {name: 'Algeria', code: 'DZ'}, | |
| {name: 'American Samoa', code: 'AS'}, | |
| {name: 'AndorrA', code: 'AD'}, | |
| {name: 'Angola', code: 'AO'}, | |
| {name: 'Anguilla', code: 'AI'}, | |
| {name: 'Antarctica', code: 'AQ'}, |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| /** | |
| Code copyright Dustin Diaz and Ross Harmes, Pro JavaScript Design Patterns. | |
| **/ | |
| // Constructor. | |
| var Interface = function (name, methods) { | |
| if (arguments.length != 2) { | |
| throw new Error("Interface constructor called with " + arguments.length + "arguments, but expected exactly 2."); | |
| } | |
| this.name = name; |
| function setEndOfContenteditable(contentEditableElement) | |
| { | |
| var range,selection; | |
| if(document.createRange)//Firefox, Chrome, Opera, Safari, IE 9+ | |
| { | |
| range = document.createRange();//Create a range (a range is a like the selection but invisible) | |
| range.selectNodeContents(contentEditableElement);//Select the entire contents of the element with the range | |
| range.collapse(false);//collapse the range to the end point. false means collapse to end rather than the start | |
| selection = window.getSelection();//get the selection object (allows you to change selection) | |
| selection.removeAllRanges();//remove any selections already made |
This is now an actual repo: