Skip to content

Instantly share code, notes, and snippets.

@goellner
goellner / brew_meilisearch_data.ms_location.txt
Created March 11, 2024 09:51
Brew meilisearch data.ms location
/opt/homebrew/var/meilisearch/data.ms
@goellner
goellner / BelongsTo.php
Created May 23, 2023 17:37
extend belongsto
<?php
namespace App\Nova\Fields;
use Laravel\Nova\Fields\BelongsTo as NovaBelongsTo;
use Laravel\Nova\Http\Requests\NovaRequest;
class BelongsTo extends NovaBelongsTo
{
public $component = 'belongs-to-with-facets';
@goellner
goellner / sql
Last active December 12, 2022 21:44
JSON validation for laravel-translatable column
ALTER TABLE user
ADD CONSTRAINT attributes_are_valid check(
JSON_SCHEMA_VALID('{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"patternProperties" : {
"^[a-z][a-z]$": {
"type": "string"
}
},
@goellner
goellner / socialredirect.php
Created August 17, 2022 12:38
Trick instagram in-app browser to open in system browser
<script type="text/javascript">
// detect instagram in-app browser on android and force a redirect
if(navigator.userAgent.includes("Instagram") && navigator.userAgent.includes("Android")){
var socialsRedirectURL = encodeURIComponent(window.location.href);
window.location.href = "https://yourdomain.example/socialredirect.php?redirect=" + socialsRedirectURL;
}
</script>
@goellner
goellner / DebugGrid.js
Created May 7, 2021 14:06
Debug Grid Tailwind
import isNil from 'lodash/isNil'
export default class DebugGrid {
constructor() {
this.debugGrid = document.querySelector('.js-debug-grid')
this.gridVisible = false
}
init() {
if (!isNil(this.debugGrid)) {
@goellner
goellner / Controller.php
Created November 17, 2020 18:34
Statamic v3 navigation structure custom API
<?php
use Statamic\Http\Controllers\Controller as BaseController;
use Statamic\Facades\Structure;
use Statamic\Structures\Page;
class Controller extends BaseController
{
public function navigations()
{
$structure = Structure::findByHandle("nav_main");
@goellner
goellner / gulpfile.js
Created September 13, 2019 13:06
Gulp file for MJML & Statamic email templates
const gulp = require('gulp');
const {series} = require('gulp');
const mjml = require('gulp-mjml');
const browserSync = require('browser-sync');
const mjmlEngine = require('mjml');
const fs = require('fs');
require('dotenv').config();
@goellner
goellner / GridDebug.js
Created January 6, 2019 00:15
Gridle Debug Toggle
import React, {Fragment} from "react";
export default class GridDebug extends React.Component {
constructor(props) {
super(props);
this.state = {
gridVisible: false
};
@goellner
goellner / cloudSettings
Last active May 29, 2020 12:18
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-29T12:18:52.703Z","extensionVersion":"v3.4.3"}