Skip to content

Instantly share code, notes, and snippets.

@freekmurze
freekmurze / 2021_02_17_103523_migrate_to_jetstream.php
Last active May 27, 2021
Migrate classic Spark tables to Jetstream + new Spark
View 2021_02_17_103523_migrate_to_jetstream.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class MigrateToJetstream extends Migration
{
public function up()
{
View ray.rb
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'
View CatchableCollection.php
<?php
namespace Illuminate\Support;
/** @mixin \Illuminate\Support\Collection */
class CatchableCollection
{
protected $originalCollection;
protected $calledMethods = [];
@freekmurze
freekmurze / action.yaml
Created May 8, 2020
Run psalm on GitHub Actions
View action.yaml
name: Psalm
on:
push:
paths:
- '**.php'
- 'psalm.xml'
jobs:
psalm:
View FuzzyFilter.php
<?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 Aug 31, 2019
Nginx config sendy
View nginx config
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;
View 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:
View HorizonDatabaseQueue.php
<?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 Feb 22, 2019
Oh Dear! Reachable bookmarklet
View bookmarklet
javascript:{window.location='https://ohdear.app/tools/reachable?prefill='+encodeURIComponent(window.location.href)}
@freekmurze
freekmurze / DiscordChannel.php
Last active Feb 28, 2021
How to use Discord webhooks
View DiscordChannel.php
<?php
namespace App\Services\NotificationChannels\Discord;
use GuzzleHttp\Client;
use GuzzleHttp\RequestOptions;
use Illuminate\Notifications\Notification;
class DiscordChannel
{