This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CHROME_VERSION=`google-chrome-stable --version | awk '{print($3)}' | awk -F '.' '{print($1"."$2"."$3)}'` | |
CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION}"` | |
echo "Chrome version: ${CHROME_VERSION}" | |
echo "Suitable chromedriver version: ${CHROMEDRIVER_VERSION}" | |
echo "" | |
echo "Downloading chromedriver..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Installation (Symfony): | |
* ======================= | |
* # services.yml | |
* services: | |
* # ... | |
* acme.rss_feed_generator: | |
* class: Acme\AcmeBundle\Service\RssFeedGeneratorService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// $this->executeWithExponentialBackOff("self::myMethodName", array("id" => 1), 64); | |
// in this exmaple myFunctionName() is private and resides in the same class as executeWithExponentialBackOff(). | |
// myFunctionName() has to throw an exception when it fails for the backoff to be performed. | |
class Foo | |
{ | |
private function executeWithExponentialBackOff($callback, $parameters, $timeout) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# /etc/init.d/selenium | |
# assumes that selenium server and chromedriver exist in: | |
# /var/selenium/selenium-server-standalone-2.45.0.jar | |
# /var/selenium/chromedriver | |
# Do NOT "set -e" | |
# PATH should only include /usr/* if it runs after the mountnfs.sh script |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# /etc/init.d/Xvfb | |
# Do NOT "set -e" | |
# PATH should only include /usr/* if it runs after the mountnfs.sh script | |
PATH=/sbin:/usr/sbin:/bin:/usr/bin | |
DESC="X virtual framebuffer" | |
NAME=Xvfb | |
DAEMON=/usr/bin/$NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/selenium.service | |
# assumes selenium server and chromedriver exist in the following paths: | |
# /var/selenium/selenium-server-standalone-2.45.0.jar | |
# /var/selenium/chromedriver | |
[Unit] | |
Description=Selenium Standalone Server | |
Requires=xvfb.service | |
After=xvfb.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/xvfb.service | |
[Unit] | |
Description=X virtual framebuffer | |
[Service] | |
Type=simple | |
User=root | |
ExecStart=/usr/bin/Xvfb :99 -ac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\AcmeBundle\Service; | |
class FileExtensionGuesserService | |
{ | |
/** | |
* Guesses the mime type of a file by raw binary or base64 encoded content | |
* and returns its file type. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Installation (Symfony): | |
* ======================= | |
* # services.yml | |
* services: | |
* # ... | |
* acme.vat_checker: | |
* class: Acme\AcmeBundle\Service\VatCheckerService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Basic Intercom API wrapper, in case you don't want to use the official, | |
* or you don't meet the requirements (ex. your PHP is < 5.6) | |
* | |
* Official: | |
* https://packagist.org/packages/intercom/intercom-php | |
*/ | |
/* |
NewerOlder