Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* The following file shows how to bootstrap phpdbg so that you can mock specific server environments
*
* eval include("web-bootstrap.php")
* exec index.php
* compile
* break ...
* run
*/
@samitny
samitny / unsubscribe-activities-to-campaign-activities.sql
Created July 9, 2014 02:38
INSERT INTO campaigns_activities from activity where activity type is "subscriber" and action is "unsubscribe". (This is for a specific campaign ID which makes the join with "email_messages" pointless.)
INSERT INTO campaigns_activities (
SELECT
a.createdAt,
a.updatedAt,
a.id,
e.campaignId
FROM
activities a
LEFT JOIN
subscribers s ON (s.uuid = a.target)
@samitny
samitny / email-activities-to-campaign-activities.sql
Last active August 29, 2015 14:03
INSERT INTO campaigns_activities from email_messages_activities where activity type is "message".
INSERT INTO campaigns_activities (
SELECT
ea.createdAt,
ea.updatedAt,
ea.activityId,
e.campaignId
FROM
email_messages_activities ea
LEFT JOIN
email_messages e ON (e.id = ea.emailMessageId)
@samitny
samitny / wp-export-users.sql
Created June 23, 2014 14:13
Wordpress Export Users
SELECT
u.ID AS id,
u.user_login AS login_name,
first_name.meta_value AS first_name,
last_name.meta_value AS last_name,
LOWER(u.user_email) AS email,
created_ip.meta_value AS created_ip,
u.user_registered AS created_at
FROM
wp_users u
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.