Skip to content

Instantly share code, notes, and snippets.

View marijoo's full-sized avatar
🔌
200 OK Cool

Marijan B▇▇c ˊˎ˗ marijoo

🔌
200 OK Cool
View GitHub Profile
@marijoo
marijoo / AssertsPolicy.php
Last active October 20, 2021 10:02
This allows to assert against the Laravel Gate by providing a simple array with policy methods.
<?php
namespace Tests\Traits;
use App\User;
use Illuminate\Support\Facades\Gate;
use ReflectionMethod;
trait AssertsPolicy
{
@marijoo
marijoo / ssh-tunneling.md
Created January 25, 2021 08:43
SSH tunneling with Safari
ssh -D 8080 -C -N username@IpAddress 

Then add SOCKS Proxy in System Preferences > Network with Server 127.0.0.1:8080.

@marijoo
marijoo / helpers.php
Last active May 19, 2024 06:44
Render ACF blocks with Sage and blade templates
<?php
// add this function to Sage’s app/helpers.php
// inspired by nicooprat: https://gist.github.com/nicooprat/2c1a642d102425d3131037e5dc156361
/**
* Render callback for ACF $blocks
* @param array $block The block settings and attributes.
* @param string $content The block inner HTML (empty).
* @param bool $is_preview True during AJAX preview.
* @param (int|string) $post_id The post ID this block is saved to.