Skip to content

Instantly share code, notes, and snippets.

View IMSoP's full-sized avatar

Rowan Tommins IMSoP

View GitHub Profile
@IMSoP
IMSoP / Apis.php
Last active May 14, 2020 21:37 — forked from mikeschinkel/Apis.php
Examples reworked to use possible try-catch extensions
<?php
class Apis {
static function JsonGET( string $api_url, array $args = array() ) {
try {
$wp_error = null;
$args = wp_parse_args( $args, array(
'response_type' => ARRAY_A,
) );
@IMSoP
IMSoP / Lazy_PDO.php
Last active January 22, 2016 19:11 — forked from anonymous/Lazy_PDO.php
<?php
class Lazy_PDO
{
private $pdo;
private $dsn, $username, $password, $options;
public function __construct($dsn, $username, $password, $options) {
$this->dsn = $dsn;
$this->username = $username;
<?php
class Closable_PDO
{
private $pdo;
public function __construct($dsn, $username, $password, $options) {
$this->pdo = new PDO($dsn, $username, $password, $options);
}
<?php
public function insert_booking_date_match(Array $dates, $rule_id)
{
$sql = "-- insert_booking_date_match
BEGIN;
DELETE FROM
rule_booking_date_match
WHERE
rule_id = ".$rule_id."
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {