Skip to content

Instantly share code, notes, and snippets.


Pablo Barrios sauron

  • San Miguel de Tucumán, Argentina
View GitHub Profile
sauron /
Created Jun 10, 2022
Override translation static copy from the Twill CMS.

FORM Creation

File: resources/views/admin/settings/interface.blade.php

@extends('twill::layouts.form', [
    'contentFieldsetLabel' => 'Home',

@formField('input', [
    'name' => 'home-a11yHeading',
sauron / RefreshCrops.php
Last active Mar 14, 2022
Refresh crops command that generates the missing crops for a given Model. This patch make sure that if a Morphmap is set, it will use it to look for the mediables. Added the ability to process crops added in the `config/twill.php`. This will cover block images.
View RefreshCrops.php
namespace A17\Twill\Commands;
use Carbon\Carbon;
use Illuminate\Database\DatabaseManager;
use Illuminate\Database\Query\Builder;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
use A17\Twill\Models\Media;
sauron / EventServiceProvider.php
Created Nov 4, 2021
Event Listener registration for clearing the cache on save. Files: app/Listeners/TwillEventSubscriber.php and in app/Providers/EventServiceProvider.php
View EventServiceProvider.php
* The subscriber classes to register.
* @var array
protected $subscribe = [
sauron /
Last active Jun 15, 2021
Step by step - Creating a Twill app - Part 1

Step by step - Creating a Twill app.

In this post, I'll create an app from the ground up. I'll assume you have PHP, Laravel and Composer. Of course a mysql DB for storing "everything." All the code it's here for reference.


Let's create a new app.

sauron / DeleteCrop
Last active May 28, 2021
☢️ DANGEROUS command to delete already created twill crops. 🔞
View DeleteCrop
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class DeleteCrops extends Command
View UpdateCrops.php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class UpdateCrops extends Command
View VS Code Key Shortcuts.json
// Place your key bindings in this file to overwrite the defaults
"key": "cmd+y",
"command": "default:redo"
* Activity Bar
sauron / VS Code Settings.json
Last active May 5, 2021
VS Code Settings. Dark Mode. Big Fonts. No panels. Focus Mode.
View VS Code Settings.json
"editor.multiCursorModifier": "ctrlCmd",
"editor.snippetSuggestions": "top",
"editor.formatOnPaste": false,
"editor.renderWhitespace": "all",
"editor.scrollBeyondLastLine": false,
"files.insertFinalNewline": true,
"editor.find.seedSearchStringFromSelection": true,
"editor.fontSize": 15,
"editor.tabSize": 4,
View Sublime USER Settings.json
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Palenight.tmTheme",
"default_line_ending": "unix",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"fallback_encoding": "UTF-8",
sauron /
Last active Oct 7, 2016
My updated version of so it always set the gem_home as the directory where there is a .ruby-version file. Line 14 contains the "super hack"
function chruby_auto() {
local dir="$PWD/" version
until [[ -z "$dir" ]]; do
if { read -r version <"$dir/.ruby-version"; } 2>/dev/null || [[ -n "$version" ]]; then
if [[ "$version" == "$RUBY_AUTO_VERSION" ]]; then return