Skip to content

Instantly share code, notes, and snippets.

View richardsweeney's full-sized avatar

Richard Sweeney richardsweeney

View GitHub Profile
{
"customer": {
"first_name": "Jakob",
"last_name": "Lindberg",
"tel": "0705111111",
"email": "jakob@lindberg.se"
},
"appointment": {
"title": "Telefonmöte",
"start_date": "2020-12-01 13:00:00",
'Test Complete Order' (browser) {
browser
.url( 'http://lavendla.se.dev.synot.io/test/' )
.waitForElementVisible( '.cart', 5000 )
.click( '.go-to-checkout' ) // This didn't work
.execute(function() { // This DID work!
document.querySelector('.go-to-checkout').click()
})
// ...test something
}
module.exports = {
'Test Something' (browser) {
browser
.url( 'https://wordpress.org/' )
.waitForElementVisible( '#download' )
.click( '#download' )
.waitForElementVisible( '.download-meta' )
.assert.urlContains( 'download' )
.end();
}
const seleniumServer = require("selenium-server");
const chromedriver = require("chromedriver");
module.exports = {
"src_folders": [
"tests/e2e" // Change this to the directory where your test are
],
"output_folder": "./reports", // the directory for your rest reports
"selenium": {
"start_process": true,
<?php
final class Singelton {
/**
* @var null|Singleton
*/
protected static $instance = null;
wp post update $(wp post list --post_type='page' --post_status='publish' --format=ids) --post_status='publish' --defer-term-counting
<?php
// in javascript, object properties are accessed as ajax_object.ajax_url, ajax_object.we_value
function pacsoft_enqueue(){
wp_enqueue_script('jquery');
// You can't hardcode the path to a plugin directory. WordPress may rename it.
// Below is incorrect.
// wp_register_script( 'pacsoft-script', plugins_url( '/woocommerce-pacsoft-unifaun/js/pacsoft.js' ) );
<?php
/**
* Register widget area.
*
* @link http://codex.wordpress.org/Function_Reference/register_sidebar
*/
add_action( 'widgets_init', function() {
register_sidebar([
'name' => __( 'Sidebar', 'shipyard' ),
@richardsweeney
richardsweeney / example
Last active February 2, 2016 08:30
NGINX site example conf
server {
listen 80;
server_name www.site.com;
return 301 $scheme://site.com$request_uri;
}
server {
listen 80;
<?php
/**
* Plugin Name: NGINX FastCGI cache purge
* Version: 0.1
* Description: Flush NGINX FastCGI cache purge
* Author: The Shipyard Crew
* Author URI: https://theshipyard.se/
* Plugin URI: https://theshipyard.se/
* Text Domain: nginx-fastcgi-cache-purge