Skip to content

Instantly share code, notes, and snippets.

View sheldonkotyk's full-sized avatar

Sheldon Kotyk sheldonkotyk

View GitHub Profile
@annedorko
annedorko / README.md
Last active August 28, 2024 03:48
TailwindCSS plugin for variable fonts: Italic, Width/Stretch, Weight
@duncanmcclean
duncanmcclean / console.php
Last active March 5, 2024 15:32
Identify & fix Duplicate IDs in Statamic 3.
<?php // copy everything after this line
Artisan::command('identify-duplicates', function () {
$duplicates = [];
$shouldFixDuplicates = $this->confirm('Should Duplicate IDs be replaced with fresh IDs?');
$items = collect(\Illuminate\Support\Facades\File::allFiles(__DIR__.'/../content'))
->filter(function ($file) {
return $file->isFile();
})
@dillinghamio
dillinghamio / Spark User Team Seeding.md
Last active November 23, 2020 13:07
Spark User Team Seeding

Seeding Users & Teams In Laravel Spark

Makes 5 users each with 1 team that has 5 members

Add a team factory to database/factories/ModelFactory.php

$factory->define(App\Team::class, function (Faker\Generator $faker) {
    return [
 'name' =&gt; $faker-&gt;sentence,
@danharper
danharper / a-FormatController.php
Last active August 1, 2017 12:06
A Laravel Controller which allows you to display API/report data in multiple formats. For example, you may display a preview as HTML, and offer buttons to download as CSV and JSON.
<?php
// this is the base controller which parses output to HTML/CSV/JSON depending on the format in the URL
use Illuminate\Support\Collection;
class FormatController extends Controller {
protected $fileName = 'export';
protected $view = 'reports.output';