Skip to content

Instantly share code, notes, and snippets.

View cgsmith's full-sized avatar
👋
Available to work on your projects!

Chris Smith cgsmith

👋
Available to work on your projects!
View GitHub Profile
<?php
namespace CGSMITH\Traits;
trait ParseOrder
{
/**
* @param $unparsedOrders
<?php
namespace common\behaviors;
use common\models\QueueDead;
use yii\queue\ExecEvent;
use yii\queue\Queue;
class DeadLetterQueue extends \yii\base\Behavior
{
@cgsmith
cgsmith / composer.json
Created March 1, 2019 13:28
BCC Postmark Transport Issue
{
"require": {
"swiftmailer/swiftmailer": "~5.2",
"wildbit/swiftmailer-postmark": "^2.1"
}
}
@cgsmith
cgsmith / docker output.txt
Created July 20, 2017 16:01
Docker Build issue
PS C:\Users\csmith\PhpstormProjects\kbp> docker-compose build --no-cache
Building app
Step 1/2 : FROM php:7.1-fpm-alpine
---> c98b2217cb9d
Step 2/2 : RUN apk update && docker-php-ext-install pdo pdo_mysql && chown -R www-data:www-data /var/www/html
&& sed -ri 's/^www-data:x:82:82:/www-data:x:1000:50:/' /etc/passwd
---> Running in 3c8826d8fdce
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
v3.4.6-165-g6b9a79f [http://dl-cdn.alpinelinux.org/alpine/v3.4/main]
@cgsmith
cgsmith / mail.php
Created January 31, 2017 19:55
OpenCart mail.php fix and integration with Postmark App
<?php
require_once 'vendor/autoload.php';
use Postmark\PostmarkClient;
use Postmark\Models\PostmarkException;
class Mail {
protected $to;
protected $from;
protected $sender;
<?php
// Add meta query clause
$args['meta_query'][] = array(
'relation' => 'AND',
array(
'key' => 'wp_user_alerts_user_ids',
'compare' => 'NOT EXISTS'
)
);
<?php
add_filter( 'register_taxonomy_args', 'wp_event_calendar_types_metabox_cb', 10, 2 );
add_filter( 'wp_terms_checklist_args', 'wp_event_calendar_radio_walker', 10, 1 );
<?php
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
/** Walker_Category_Checklist class */
require_once( ABSPATH . 'wp-admin/includes/class-walker-category-checklist.php' );
/**
* Extends Walker_Category_Checklist and uses radio input instead of checklist
*
* @since 0.4.1
*/
@cgsmith
cgsmith / sparkposthook.php
Created May 25, 2016 13:47
SparkPost Hook for PHPList
<?php
error_reporting(0); // do not log errors to... anywhere :)
$databaseHost = 'localhost';
$databaseName = '';
$databaseUser = '';
$databasePassword = '';
$databaseTable = '';
$phpAuthUser = '';
$phpAuthPass = '';
<?php
// English -> Japanese examples from Google Translate
return array(
'SD Card Program List' => 'SDカードのプログラムリスト',
'Name' => '名前',
'Created' => '作成',
'Modified' => '変更されました',
'No programs listed yet' => 'なしのプログラムがまだ表示されません',
'Create program' => 'プログラムを作成します',