Skip to content

Instantly share code, notes, and snippets.

View paulgibbs's full-sized avatar

Paul Wong-Gibbs paulgibbs

View GitHub Profile
$ uname -a
Darwin Pauls-MacBook-Air.local 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
$ which -a php
/usr/local/php5/bin/php
/usr/bin/php
$ php -v
PHP 7.1.1 (cli) (built: Feb 13 2017 10:05:49) ( NTS )
Copyright (c) 1997-2017 The PHP Group
@vagrant:
ssh: vagrant@172.28.128.3
path: /vagrant/wp
@paulgibbs
paulgibbs / gist:67d97e52d4af78d6ba3b4149ea91b8d2
Created July 8, 2017 12:01
Run Behat from inside a VM, using a browser on your desktop.
extensions:
Behat\MinkExtension:
base_url: http://vagrant.local
browser_name: chrome
default_session: default
javascript_session: selenium2
sessions:
default:
goutte:
guzzle_parameters:
default:
suites:
default:
contexts:
- Behat\MinkExtension\Context\MinkContext
- PaulGibbs\WordpressBehatExtension\Context\ContentContext
- PaulGibbs\WordpressBehatExtension\Context\DashboardContext
- PaulGibbs\WordpressBehatExtension\Context\SiteContext
- PaulGibbs\WordpressBehatExtension\Context\UserContext
- PaulGibbs\WordpressBehatExtension\Context\WordpressContext
paths:
# Base directory for reference. Relative to the Chassis directory.
base: wp
# Where WordPress lives. Relative to the base directory.
wp: .
# Content directory. Relative to the base directory.
content: wp-content
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
@paulgibbs
paulgibbs / wut.php
Last active January 8, 2017 11:29
weird php
<?php
$argv = array_slice( $GLOBALS['argv'], 1 );
die(var_dump(array(
$argv,
$argv[$i],
serialize($argv[$i]),
json_encode($argv[$i]),
json_decode(json_encode($argv[$i]))
)));
WHSHASCRIPT="sha1sum" && (type sha1sum >/dev/null 2>&1 || WHSHASCRIPT="shasum")
Feature: Product basket
In order to buy products
As a customer
I need to be able to put interesting products into a basket
Scenario: Buying a single product under £10
Given I am logged in as an admin
When I add the "Sith Lord Lightsaber" to the basket.
Then I should see an error message that says "yolo"