Skip to content

Instantly share code, notes, and snippets.

View robwilde's full-sized avatar
🏠
Just keep Coding, keep on Coding...

Robert Wilde robwilde

🏠
Just keep Coding, keep on Coding...
View GitHub Profile
@robwilde
robwilde / Dockerfile
Created June 14, 2019 06:05 — forked from michaelneu/Dockerfile
docker-compose configuration for PHP with NGINX and MySQL, including sendmail, MailDev and phpmyadmin
# see https://github.com/cmaessen/docker-php-sendmail for more information
FROM php:5-fpm
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mysql mysqli sysvsem
RUN pecl install xdebug-2.5.5 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@robwilde
robwilde / Dockerfile
Created June 4, 2019 11:19 — forked from md5/Dockerfile
Testing docker-php-ext-install sockets
FROM php
RUN docker-php-ext-install sockets
COPY test.php /
CMD ["php", "/test.php"]
@robwilde
robwilde / postgres-cheatsheet.md
Created June 4, 2019 09:35 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@robwilde
robwilde / example-wp-list-table.php
Created May 25, 2018 13:32 — forked from paulund/example-wp-list-table.php
An example code of using the WP_List_Table class. With Pagination.
<?php
/*
* Plugin Name: Paulund WP List Table Example
* Description: An example of how to use the WP_List_Table class to display data in your WordPress Admin area
* Plugin URI: http://www.paulund.co.uk
* Author: Paul Underwood
* Author URI: http://www.paulund.co.uk
* Version: 1.0
* License: GPL2
*/
@robwilde
robwilde / README.md
Created February 7, 2018 00:48 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
&amp;&amp; echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" &gt; /usr/local/etc/php/conf.d/xdebug.ini \
@robwilde
robwilde / caldera-forms-rest-api-client-usage.js
Created November 12, 2017 10:31 — forked from Shelob9/caldera-forms-rest-api-client-usage.js
Example code for using the Caldera Forms REST API JavaScript client. See: https://calderaforms.com/doc/caldera-forms-rest-api/
/**
* Get form config details
*
* api is instance of CFAPI
*/
var form = api.getForm();
/**
* Get first page of entries
*
<?php
class MyCPTs {
public function __construct() {
add_action( 'init', array ( $this, 'load_cpts'), 0 );
}
/**
@robwilde
robwilde / keybase.md
Created April 3, 2017 16:55
keybase.md

Keybase proof

I hereby claim:

  • I am robwilde on github.
  • I am mrwilde (https://keybase.io/mrwilde) on keybase.
  • I have a public key ASBzOQ6SV8xandPeGPa00GqIfwxqOc7j1K-t_2jWAVMGawo

To claim this, I am signing this object:

@robwilde
robwilde / gist:fa00607c7e341fd46cb2ed1c6d8aabfd
Created April 2, 2017 14:22 — forked from supermethod/gist:913394
Convert a PHP array into XML file using SimpleXML
class ArrayToXML
{
/**
* The main function for converting to an XML document.
* Pass in a multi dimensional array and this recrusively loops through and builds up an XML document.
* Based on: http://snipplr.com/view/3491/convert-php-array-to-xml-or-simple-xml-object-if-you-wish/
*
* @param array $data
* @param string $rootNodeName - what you want the root node to be - defaultsto data.
* @param SimpleXMLElement $xml - should only be used recursively
@robwilde
robwilde / testing.php
Created March 1, 2017 05:03
blank testing page for bootstrap theme
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">