Skip to content

Instantly share code, notes, and snippets.

View renalpha's full-sized avatar

Jason Hoendervanger renalpha

View GitHub Profile
@renalpha
renalpha / Import.php
Last active March 19, 2024 01:34
RedisVectorConnector.php
<?php
private function indexVector(SplFileInfo $file, string $content): void
{
$metaData = $this->getMetaData($file, $content);
/** @var RedisVector $redisVectorService */
$redisVectorService = app(RedisVector::class);
/** @var \Exdeliver\LaraPal\Connectors\VoyageAIEmbedding $voyage */
@renalpha
renalpha / LocalValetDriver.php
Last active August 30, 2023 06:43
LocalValetDriver for Typo3 working on Laravel Herd
<?php
class LocalValetDriver extends Valet\Drivers\ValetDriver
{
/*
|--------------------------------------------------------------------------
| Document Root Subdirectory
|--------------------------------------------------------------------------
|
| This subdirectory contains the public server resources, such as the
@renalpha
renalpha / Index.html
Created August 19, 2023 13:44
Ionic Capacitor <video> remote URL IOS Android
<video autoplay loop muted playsinline preload="metadata" webkit-playsinline="webkit-playsinline">
<source src="https://yoururl.test/video/smallerbg-te.mp4" type="video/mp4"/>
</video>
@renalpha
renalpha / DockerFile
Last active January 5, 2024 16:04
Traefik
FROM php:7.4-fpm
RUN apt-get update && apt-get install -y libldb-dev libldap2-dev libzip-dev libpng-dev libjpeg62-turbo-dev libfreetype6-dev \
&& docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-install -j$(nproc) zip pdo pdo_mysql gd ldap pcntl opcache
@renalpha
renalpha / TimeService.php
Last active March 30, 2020 15:50
Get a group of dates and group them by X minutes (timetables)
<?php
namespace App\Services;
use ArrayIterator;
use Carbon\Carbon;
use Illuminate\Support\Collection;
class TimeService
{
@renalpha
renalpha / On mac
Created January 20, 2020 13:15
Mac os Valet fix Guzzle SSL error
cp /usr/local/etc/openssl/cert.pem /usr/local/etc/openssl/cert.pem.bak && cat ~/.config/valet/CA/LaravelValetCASelfSigned.pem >> /usr/local/etc/openssl/cert.pem
@renalpha
renalpha / LocalValetDriver.php
Last active January 16, 2020 09:07
LocalValetDriver for Typo3
<?php
/**
* This driver serves TYPO3 instances (version 7.0 and up). It activates, if it
* finds the characteristic typo3/ folder in the document root, serves both
* frontend and backend scripts and prevents access to private resources.
*/
class LocalValetDriver extends ValetDriver
{
/*
@renalpha
renalpha / phpstorm settings.txt
Created September 20, 2019 11:49
phpcs on save
Preferences -> tools -> File watchers
// Program
vendor/path/to/phpcs
// Arguments
--standard=phpcs.xml --encoding=utf-8 $FilePath$
// Working directory and environments variables
/path/to/your/project/dir
@renalpha
renalpha / AbstractQuery.php
Last active August 15, 2019 12:56
DataComponent for Laravel-Vue-Pagination
<?php
namespace App\Queries;
use Spatie\QueryBuilder\QueryBuilder;
abstract class AbstractQuery extends QueryBuilder
{
/**
* @var array
@renalpha
renalpha / OverviewController.php
Created August 6, 2019 13:05
Laravel save pagination filters in session
<?php
class OverviewController
{
/**
* Process the request and apply to a session.
*
* @param \Illuminate\Http\Request $request
* @param string $filter
* @return \Illuminate\Http\Request