Skip to content

Instantly share code, notes, and snippets.

View tambaqui's full-sized avatar

Raúl Solana tambaqui

View GitHub Profile
@tambaqui
tambaqui / wpdb-transactions
Created April 24, 2022 13:45 — forked from nciske/wpdb-transactions
MySQL database transaction, using the WordPress database object $wpdb. Requires the InnoDB table format.
<?php
global $wpdb;
// Start Transaction
$wpdb->query( "START TRANSACTION" );
// Do some expensive/related queries here
//$wpdb->query("DELETE FROM table WHERE form_id = '1' ");
//$wpdb->query("DELETE FROM data WHERE form_id = '1' ");
// set $error variable value in error handling after $wpdb modifications
@tambaqui
tambaqui / jquery.ba-tinypubsub.js
Created September 14, 2012 17:25 — forked from cowboy/HEY-YOU.md
JavaScript: jQuery Tiny Pub/Sub
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);