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
@cgsmith
cgsmith / README.md
Last active May 16, 2024 13:06
Deployed Laravel App with Bitbucket Pipelines

Laravel + Bitbucket Pipeline Deployment

This is the process I use for deploying a Laravel application to Bitbucket. Once I setup the Debian server with Caddy and PHP-FPM it is usually ready to go.

Debian preparedness

  1. Install Caddy
  2. Install PHP-FPM
  3. mkdir -p /var/builds/staging.example.com && mkdir -p /var/www
  4. Create .env and storage folder in /var/builds/staging.example.com
<?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 = '';