Skip to content

Instantly share code, notes, and snippets.

View Spriz's full-sized avatar

Mikkel Bonde Wiuff Spriz

  • Apacta.com
  • Aalborg, Denmark
  • 16:52 (UTC +02:00)
View GitHub Profile
<?php
private function fillVendorProductsData(ConsoleIo $io)
{
$client = Typesense::getTypesenseClient(true);
/** @var \App\Model\Table\VendorProductsTable $table */
$table = $this->getTableLocator()->get('VendorProducts');
$collection = $client->getCollections()['vendor_products'];
assert($collection instanceof \Typesense\Collection);
@Spriz
Spriz / foo.js
Last active November 16, 2023 13:45
//If inputData.rawMessage does not contain "just signed" - abort
if (!inputData.rawMessage.includes("just signed")) {
return;
}
const emojis = [
"rocket",
"success",
"tada",
"v",
@Spriz
Spriz / gist:8f7fea16d6f5d1e567bd54df60fb2e80
Created April 23, 2019 21:18 — forked from rctphone/gist:62f75cf2f0293bdc9dd27eebac1d5c61
How to solve "APFS inverter failed to invert the volume" error
After cloning APFS drives using Disk Utility it usually ends with a volume containing ContainerToInvert file with the size of a cloned partition.
Don't be afraid, using the following steps you can mount this file as APFS container and get all partitions.
1. Requirements
We need FUSE and xmount installed
2. Terminal
Open Terminal app and type the following:
$ sudo mkdir /Volumes/apfs_image/

Tools we're using

  • Puphpet
  • Vagrant
    • Handling provisioning of virtual machines with static files
  • Virtualbox
    • "Backend" that runs the virtual machines started by Vagrant - should not be used directly for anything
    • Remember also "VirtualBox Oracle VM VirtualBox Extension Pack" from the download page

How things are put together

Keybase proof

I hereby claim:

  • I am spriz on github.
  • I am spriz (https://keybase.io/spriz) on keybase.
  • I have a public key whose fingerprint is 2857 1F5B 8277 0A10 409E 9226 8E67 364C A349 43ED

To claim this, I am signing this object:

$query->leftJoinWith('TicketExecutors')
->where(['TicketExecutors.id' => $options['request']['restrictByUserId']])
->leftJoinWith('TicketOwners')
->orWhere(['TicketOwners.id' => $options['request']['restrictByUserId']]);
<?php
namespace App\Controller\Component;
use Cake\Controller\Component\PaginatorComponent;
use Cake\Datasource\RepositoryInterface;
use Cake\Network\Exception\NotFoundException;
use Cake\ElasticSearch\Query;
class ElasticPaginatorComponent extends PaginatorComponent
@Spriz
Spriz / src\Pdf\Engine\TexToPdfEngine.php
Created December 10, 2015 15:28 — forked from burzum/src\Pdf\Engine\TexToPdfEngine.php
src/Pdf/Engine/TexToPdfEngine.php
<?php
namespace App\Pdf\Engine;
use CakePdf\Pdf\CakePdf;
use CakePdf\Pdf\Engine\AbstractPdfEngine;
use Cake\Core\Exception\Exception;
use Cake\Utility\Text;
/**
* TexToPdfEngine for the CakePdf Plugin