Skip to content

Instantly share code, notes, and snippets.

View assertchris's full-sized avatar
💭
I may be slow to respond.

Christopher Pitt assertchris

💭
I may be slow to respond.
View GitHub Profile
<?php
class RequestId
{
}
class ClientId
{
}
class AgencyId
{
<?php
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use Spatie\YamlFrontMatter\YamlFrontMatter;
Route::get('{slug?}', function ($slug = 'index') {
$path = resource_path('pages/' . $slug . '.md');
if (!file_exists($path)) {
@assertchris
assertchris / CacheProxy.php
Created December 24, 2019 19:08
Livewire state hoops
<?php
namespace App\Http\Livewire;
class CacheProxy
{
private $key;
public function __construct($key)
{

Background processing with AWS Lambda

You've probably heard a few talks about queued jobs processing, in your favourite framework. I'm here to show you that AWS Lambda can do the work of a dedicated background processing app at a fraction of the cost and complexity.

In this talk, we'll take a look at an app that processes user-submitted audio files, and returns the waveform images back. We'll cover what you need to know to get this kind of app working, and how Lambda interacts with other AWS services (like S3).

Next.js: the React framework

Ever struggle with structuring ReactJS apps, and all the tooling that it requires? Next.js is the perfect way to learn and use it, to build small and stable applications; that have ReactJS front-ends. In this talk, we'll look at how to build these kinds of apps. We'll also look at topics like animation and tools like styled components.

You'll soon forget about your Webpack worries, as Next.js lets you focus on what you want to build.

You don't need to know anything about Next.js to attend this talk, but familiarity with ReactJS will be useful.

Laravel but in NodeJS

Ever wanted to give full-stack JS a try, but don't know where to start? AdonisJS is JS framework, inspired by Laravel. It has a similar ORM, similar routing, and all the other bits you'd expect to use in a Laravel app. In this talk, we'll review the differences and similarities between the two. We'll also learn about the native async/await functionality you can use, to increase the number of users your site can support.

You don't need to know anything about AdonisJS to attend this talk, but a familiarity with Laravel will be useful.


Hosting Docker apps on AWS, with Fargate

It's one thing to make your app run in Docker, but it's another to put that on the internet. In this talk, we'll look at what it takes to get your Dockerized app running in AWS. Along the way, we'll learn about load balancers, Cloudformation, and Fargate.

Don't panic! You don't need to know anything about AWS to attend this talk.


<?php
namespace App\Http\Livewire;
use App\Models\Share;
use Carbon\Carbon;
use Livewire\Component;
class SharedByMe extends Component
{
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class SelectProvider extends Component
{
const hasSeenComponentSessionKey = 'livewire:has-seen-providers';
<?php
// snip
public function uploadImage($id, $name, $type, $size, $data)
{
$raw = substr($data, strpos($data, ',') + 1);
$raw = base64_decode($raw);
$uuid = (string) Str::uuid();