Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am mattstauffer on github.
  • I am mattstauffer ( on keybase.
  • I have a public key whose fingerprint is AD6F 7CE7 553D A9C7 89A6 07C9 ED60 D8FD 9359 6537

To claim this, I am signing this object:

mattstauffer /
Last active Mar 5, 2020
Serving Statamic data from in-memory cache

Ed Finkler (Funkatron) asked me, in response to my recent article introducing Statamic, whether you could change Statamic's settings to serve from something other than the local disk.

I checked with Jason & Jack at Statamic, and they told me three things:

  1. Statamic already has the ability (if configured a certain way) to compile all the files down to HTML. It's possible (I don't know how yet, but I know it is) to configure Nginx to serve those files directly.
  2. Statamic v1 has a static site generator built-in, and v2 will get one soon.
  3. Since Statamic's .env file effects the behavior of its Laravel core, you can change the cache driver that your Statamic app is using just like you would in any Laravel app. Just add a CACHE_DRIVER key in .env file and set it to any of the options: 'file', the default; 'database'; 'memcached'; 'redis';
View app.js
new Vue({
el: '#assignment-creator',
data: {
trainee: {}
ready: function () {
this.trainee = TrainRemote.trainee;
mattstauffer / env.helper.php
Created Nov 22, 2015
Laravel's env() helper
View env.helper.php
* Gets the value of an environment variable. Supports boolean, empty and null.
* @param string $key
* @param mixed $default
* @return mixed
function env($key, $default = null)
mattstauffer / gist:a2376484ea2e19325e3c
Last active Mar 5, 2020 — forked from rtablada/gist:dcf0f82d8ca4c914fd9b
Something something node modules something
View gist:a2376484ea2e19325e3c

(just a test, this is written by @rtablada not me)

After working with a lot of node modules I'm a bit angered by the fact that for a lot of these packages you have to pass around and keep track of a single shared instance throughout your application.

This works fine for small proxy servers and apps where the whole thing fits into a single app.js or maybe a handful of route files. But as things start to grow this model really breaks down and becomes cumbersome.

Just think about a resource file for app/resources/users.js which needs the current Redis or RabbitMQ connection to publish events like user registration, a database connection to persist things, and probably a instance because it's Real Time: it's so hot right now! If you export a function that allows these to be injected, your resource has boilerplate.

mattstauffer /
Last active Oct 12, 2020
Introducing Gistlog landing pages

It's great that Gistlog makes it easy to write Gist-powered, Markdown-formatted, blog posts. But what if you want to use it as your entire blogging platform? We're working on it, and here's a first step: user landing pages.

Any Github user that has any public gists that contain a file named gistlog.yml now have a landing page on Gistlog at So, since I have (more than) one, you can view my landing page at It's very simple right now, but we have a ton of ideas to improve it over time. So go check it out.

How do you get your own Gistlog landing page?

  1. Create a new Gistlog Gist (or edit an old one)
  2. Create two files: one for the markdown (I recommend for the name) and one for the Gistlog settings (which must be named gistlog.yml)
  3. Write your blog post in
  4. Since there are no actual settings being parsed from gistlog.yml yet, just create it with the fol
mattstauffer /
Last active Jun 23, 2021
Testing my first blog post using Gistlog.yml

CHECK ME OUT I'm writing blog posts in Markdown sucka! IN MARKDOWN IN A GIST OMG I AM SO EXCITE

Maybe I should fill this post up with cat GIFs just in case anyone ever visits it. Huh? Yah?

mattstauffer /
Last active Aug 29, 2015
First Blog Post with Gistlog.yml

Publish me bro

mattstauffer /
Last active Jun 25, 2021
Introduction to GistLog

So, you might be asking yourself, what is GistLog?

GistLog is a blogging "platform" for people who want to quickly write and publish content, in Markdown, and don't want to bother with yet another platform and yet another login and yet another group hoarding their content. With GistLog, you use your pre-existing GitHub login, you store the data in your own GitHub account, and you can publish with a single click.

Using GistLog

  1. Create a public gist with a single file using Markdown. Set the gist description to be the title of your blog post
  2. Copy the gist URL, and paste it into the text box on the GistLog create page
  3. Copy your resulting URL and share it as your blog post—note that it will be in the form of
  4. If you want to have your own GistLog landing page (e.g., [read all about it](
mattstauffer /
Last active Aug 29, 2015
API changes to Laravel

The goal is to track all API changes to Illuminate components for the 4->5 upgrade.

If you run into any issues with using your Illuminate components the same way you did in 4, please leave them as a comment here so we can document it all.

Note that this is different from framework changes in terms of how you boot the application, structure your application, etc.--there's a separate gist for that.