Skip to content

Instantly share code, notes, and snippets.

@phpdave
phpdave / sigh.cls
Created May 20, 2019 19:12 — forked from tsalb/sigh.cls
Sanity check your org's CRUD
String DEBUG_TEMPLATE = 'C:[C] R:[R] U:[U] D:[D] MA:[MA] RA:[RA] | [PROFILE_NAME] | [OBJECT_NAME]';
String TRUE_TEMPLATE = '[X]'; // do not use space, horizontal char alignment will be off
String FALSE_TEMPLATE = '[_]'; // same
Integer PROFILE_NAME_MAX_LENGTH;
// Grab the max chars of each, so we can get an evenly formatted / spaced output later
List<Integer> nameLengths = new List<Integer>();
for (Profile profile : [SELECT Name FROM Profile]) {
nameLengths.add(profile.Name.length());
}
@phpdave
phpdave / selenium-php-webdriver-cheatsheet.md
Created April 5, 2016 16:45 — forked from aczietlow/selenium-php-webdriver-cheatsheet.md
Cheat sheet for using php webdriver (facebook/webdriver).

Webdriver PHP API workthough

  • 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);

#!/bin/bash -xv
# Initialize Amazon Linux AMI 2015.09 for PHP7 Web Application
# yum
# update default
sudo yum upgrade --enablerepo="*" -y
# install php
for i in $(seq 3)
do
[ ! -s remi-release-6.rpm ] && curl --connect-timeout 3 http://remi.kazukioishi.net/enterprise/remi-release-6.rpm > remi-release-6.rpm