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 | |
# Make a directory with some test directories and files inside | |
mkdir test | |
cd test | |
mkdir test1 | |
mkdir test2 | |
mkdir test3 | |
touch hello.txt | |
touch goodbye.txt |
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 | |
/* | |
* Yes this isn't sanitised, in case there are | |
* special characters in the serialized data | |
* | |
* ... therefore no this isn't safe to put on a | |
* public web server! | |
*/ |
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 | |
// Load application-specific configuration | |
try { | |
$basepath = __DIR__ . '/config'; | |
$configuration = Yaml::parse($basepath . '/config.yml'); | |
} catch (\InvalidArgumentException $exception) { | |
exit("Are you sure the configuration files exist?"); | |
} |
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
SET GLOBAL general_log = 'ON'; | |
SET GLOBAL general_log_file = '/var/log/mysql/all.log'; |
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
<!DOCTYPE html> | |
<html ng-app='something'> | |
<head> | |
<meta charset='utf-8'> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> | |
<script | |
src="//cdn.rawgit.com/jpillora/xdomain/0.7.3/dist/xdomain.min.js" | |
slave="//api.yourdomain.ca/proxy.html"> |
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
<!DOCTYPE HTML> | |
<script | |
src="//cdn.rawgit.com/jpillora/xdomain/0.7.3/dist/xdomain.min.js" | |
master="https://www.yourdomain.ca"> | |
</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
var url = 'https://www.example.com/mortgages?province_id=4'; | |
var provinceId = 7; | |
var regularExpression = new RegExp("[\\?&]" + 'province_id' + "=([^&#]*)"), | |
delimeter = regularExpression.exec(url)[0].charAt(0), | |
newUrl = url.replace(regularExpression, delimeter + 'province_id' + "=" + provinceId); | |
alert(url); | |
alert(newUrl); |
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
default: | |
suites: | |
web: | |
paths: [ %paths.base%/features ] | |
contexts: [ WebContext ] | |
extensions: | |
Behat\MinkExtension: | |
base_url: 'https://localhost' | |
goutte: |
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 | |
/** | |
* @AfterStep | |
*/ | |
public function takeScreenshotAfterFailedStep($event) | |
{ | |
if ($event->getTestResult()->getResultCode() === \Behat\Testwork\Tester\Result\TestResult::FAILED) { | |
$driver = $this->getSession()->getDriver(); | |
if ($driver instanceof \Behat\Mink\Driver\Selenium2Driver) { |
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 | |
/** | |
* @AfterStep | |
*/ | |
public function takeScreenshotAfterFailedStep($event) | |
{ | |
if ($event->getTestResult()->getResultCode() === \Behat\Testwork\Tester\Result\TestResult::FAILED) { | |
$driver = $this->getSession()->getDriver(); | |
if ($driver instanceof \Behat\Mink\Driver\Selenium2Driver) { |