Skip to content

Instantly share code, notes, and snippets.

View justinyost's full-sized avatar

Justin Yost justinyost

View GitHub Profile
@justinyost
justinyost / mail-mate-print.log
Created December 23, 2020 04:23
MailMate Crash in Big Sur when Printing
Process: MailMate [61064]
Path: /Applications/MailMate.app/Contents/MacOS/MailMate
Identifier: com.freron.MailMate
Version: 1.13.2 (5673)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: MailMate [61064]
User ID: 501
Date/Time: 2020-12-22 20:21:53.097 -0800
@justinyost
justinyost / coroutine.php
Created January 10, 2020 03:01
Generators Sample Code
<?php
class Task {
protected $taskId;
protected $coroutine;
protected $sendValue = null;
protected $beforeFirstYield = true;
public function __construct($taskId, Generator $coroutine) {
$this->taskId = $taskId;
$this->coroutine = $coroutine;
@justinyost
justinyost / sample.php
Last active June 19, 2019 14:13
CakePHP 3 Example Setting a Mocked Model Instance for a Controller
<?php
public function testResetPasswordPostRequestSaveFails() {
$UserEntity = $this
->getMockBuilder('\App\Model\Entity\User')
->getMock();
$UsersTable = $this
->getMockBuilder('\App\Model\Table\UsersTable')
->setMethods([
'clearExpiredPasswordResetCodes',
@justinyost
justinyost / new.php
Last active April 21, 2016 16:35
Swapping an anonymous function call with an Invoke Class
$collection = $itemCollection
->map(new EnsureIsItem());
class EnsureIsItem {
/**
* Construct a new instance of the class.
*/
public function __construct() {
}
@justinyost
justinyost / GenericJoinsFixture.php
Created July 22, 2015 17:12
Cake Bake Issue With UUIDs
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* GenericJoinsFixture
*
*/
class GenericJoinsFixture extends TestFixture
@justinyost
justinyost / error-response.json
Last active August 29, 2015 14:19
Error Response for Serializers
{
"errors": {
"is_composite": "Is Composite? must be true or false.",
"pit_bin_location_slug": "Pit Bin Location Slug must not be empty.",
"analysis_customers": [
{
"sales_order": "Sales Order must not be empty."
},
{},
{
@justinyost
justinyost / gist:dcb163d7887d917a0c8c
Created June 17, 2014 20:59
Sample Model with a Different Modified Date/Time Value in the Database
<?php
App::uses('AppModel', 'Model');
/**
* Blog Model
*
*/
class Blog extends AppModel {
public $actsAs = array(
'Sitemap.Sitemap' => array(
// options for the Sitemap Behavior
@justinyost
justinyost / Blog.php
Created June 17, 2014 20:57
Sample Model With Modified DateTime Field Unset
<?php
App::uses('AppModel', 'Model');
/**
* Blog Model
*
*/
class Blog extends AppModel {
public $actsAs = array(
'Sitemap.Sitemap' => array(
// options for the Sitemap Behavior
@justinyost
justinyost / Blog.php
Created June 14, 2014 21:09
Sample Model for Sitemap
<?php
App::uses('AppModel', 'Model');
/**
* Blog Model
*
*/
class Blog extends AppModel {
public $actsAs = array(
'Sitemap.Sitemap' => array(
// options for the Sitemap Behavior
@justinyost
justinyost / vagrant ssh debug log
Created April 3, 2014 21:30
vagrant debug logs
INFO global: Vagrant version: 1.5.0
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.5.0/bin/vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Darwin"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
INFO global: VAGRANT_LOG="debug"