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 / Spark helper functions.php
Last active May 3, 2016 16:31
Spark helper functions
<?php
/**
* @return \App\User|null
*/
function currentUser()
{
return request()->user();
}
@freekmurze
freekmurze / Upgrade PHP 5 to 7 on a Forge provisioned server.md
Last active February 20, 2017 04:17
Upgrade PHP 5 to 7 on a Forge provisioned server

sudo add-apt-repository ppa:ondrej/php

sudo apt-get install php7.0

sudo apt-get install php7.0-gd

sudo apt-get install php7.0-mysql

sudo apt-get install php-memcached

@freekmurze
freekmurze / validate.md
Last active February 15, 2018 17:29
A handy validate function for Laravel 5
/**
 * Validate some data.
 *
 * @param string|array $fields
 * @param string|array $rules
 * @return bool
 */
function validate($fields, $rules)
{
@freekmurze
freekmurze / GitHub.icls
Created May 7, 2018 09:07
GitHub PhpStorm colorscheme
<scheme name="GitHub" version="142" parent_scheme="Default">
<option name="FONT_SCALE" value="1.0" />
<metaInfo>
<property name="created">2018-05-07T11:01:49</property>
<property name="ide">PhpStorm</property>
<property name="ideVersion">2018.1.0.0</property>
<property name="modified">2018-05-07T11:02:04</property>
<property name="originalScheme">GitHub</property>
</metaInfo>
<option name="LINE_SPACING" value="1.4" />
@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)}
@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 / 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 / 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 / deploy.php
Last active February 5, 2021 02:43
A sample deploy.php file that can be used with Deployer (http://deployer.in)
<?php
/*
* Define the servers
*/
server('production-web', '<your server url>')
->path('<path to the project on your server>')
->user('<user on the server>')
->pubKey();
/*