Skip to content

Instantly share code, notes, and snippets.

View freekmurze's full-sized avatar

Freek Van der Herten freekmurze

View GitHub Profile
@freekmurze
freekmurze / 2021_06_25_101000_migrate_to_next_gen_spark.php
Created July 7, 2021 23:07
Migrating Flare from Spark classic to Spark Next
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void
{
$this
@freekmurze
freekmurze / 2021_02_17_103523_migrate_to_jetstream.php
Last active June 11, 2022 19:55
Migrate classic Spark tables to Jetstream + new Spark
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class MigrateToJetstream extends Migration
{
public function up()
{
@freekmurze
freekmurze / ray.rb
Created February 9, 2021 07:49
Ruby Ray
uri = URI('http://localhost:23517')
req = Net::HTTP::Post.new(uri, {'Content-Type' => 'application/json'})
req.body = {
uuid: SecureRandom.uuid,
payloads: [
{
type:'log',
content: {
values: [
'hey'
@freekmurze
freekmurze / CatchableCollection.php
Created June 3, 2020 14:28
Try Catch Collections
<?php
namespace Illuminate\Support;
/** @mixin \Illuminate\Support\Collection */
class CatchableCollection
{
protected $originalCollection;
protected $calledMethods = [];
@freekmurze
freekmurze / action.yaml
Created May 8, 2020 21:00
Run psalm on GitHub Actions
name: Psalm
on:
push:
paths:
- '**.php'
- 'psalm.xml'
jobs:
psalm:
@freekmurze
freekmurze / FuzzyFilter.php
Created February 19, 2020 08:38
FuzzyFilter
<?php
namespace Spatie\Mailcoach\Http\App\Queries\Filters;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Spatie\QueryBuilder\Filters\Filter;
class FuzzyFilter implements Filter
@freekmurze
freekmurze / nginx config
Created August 31, 2019 19:45
Nginx config sendy
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name sendy.freek.dev sendy.murze.be;
root /home/forge/sendy.freek.dev;
# FORGE SSL (DO NOT REMOVE!)
ssl_certificate /etc/nginx/ssl/sendy.freek.dev/xxxxxx/server.crt;
ssl_certificate_key /etc/nginx/ssl/sendy.freek.dev/xxxxxx/server.key;
@freekmurze
freekmurze / ci.yml
Created August 27, 2019 18:11
CI YML
on: push
name: Run phpunit testsuite
jobs:
phpunit:
runs-on: ubuntu-latest
container:
image: lorisleiva/laravel-docker:7.3 # Change this to 7.1/7.2/7.3 to specify the PHP Version
steps:
<?php
namespace App\Libraries\Queue;
use Illuminate\Events\Dispatcher;
use Illuminate\Queue\DatabaseQueue;
use Illuminate\Support\Str;
use Laravel\Horizon\Events\JobDeleted;
use Laravel\Horizon\Events\JobPushed;
use Laravel\Horizon\Events\JobReleased;
@freekmurze
freekmurze / bookmarklet
Last active February 22, 2019 10:13
Oh Dear! Reachable bookmarklet
javascript:{window.location='https://ohdear.app/tools/reachable?prefill='+encodeURIComponent(window.location.href)}