Skip to content

Instantly share code, notes, and snippets.

View techenby's full-sized avatar

Andy Newhouse techenby

View GitHub Profile
@DanielCoulbourne
DanielCoulbourne / StateSynth.php
Created May 15, 2024 14:16
A Livewire Synth for Verbs States
<?php
namespace App\Livewire\Synths;
use Livewire\Mechanisms\HandleComponents\Synthesizers\Synth;
use Thunk\Verbs\State;
class StateSynth extends Synth
{
public static $key = 'VrbSt';
@mpociot
mpociot / FetchGitHubTotals.php
Last active November 6, 2024 14:28
GitHub component for the excellent Spatie dashboard package from https://github.com/spatie/dashboard.spatie.be
<?php
namespace App\Components\GitHub;
use App\Events\GitHub\FileContentFetched;
use App\Events\GitHub\TotalsFetched;
use GitHub;
use Illuminate\Console\Command;
class FetchGitHubTotals extends Command
@JacobBennett
JacobBennett / ReadMe.MD
Last active January 14, 2025 04:40
Loading Laravel Sentry only for production

Loading Laravel Sentry package only for production

In the case that you don't want development errors making their way to Sentry for error tracking, you can use the code below to ensure that Sentry will only record exceptions when in production.

First, instead of loading the SentryLaravelServiceProvider in the config/app.php providers array, we will load it in our App/Providers/AppServiceProvider.php. This allows us to check the environment before loading the appropriate service providers.

Seconly, in our App/Exceptions/Handler.php we again check for the production environment before trying to capture the exception using Sentry. This second step prevents Sentry from trying to catch an exception when it isn't bound in the container.

@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,
@JacobDB
JacobDB / wkqx.php
Created March 15, 2016 19:26
Web scraper to convert TuneGenie in to RSS
<?php
$url = "http://wkqx.tunegenie.com/";
$title = "WKQX RSS Feed";
$description = "A constantly updated feed for WKQX's playlist";
$userAgent = "Googlebot/2.1 (http://www.googlebot.com/bot.html)";
header("Content-type: text/xml; charset=utf-8", true);
echo "<?xml version='1.0' encoding='UTF-8' ?>" . PHP_EOL;
echo "<rss version='2.0'>" . PHP_EOL;