Skip to content

Instantly share code, notes, and snippets.

View mattstauffer's full-sized avatar

Matt Stauffer mattstauffer

View GitHub Profile
@mattstauffer
mattstauffer / blog.md
Last active March 5, 2020 18:44
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';
new Vue({
el: '#assignment-creator',
data: {
trainee: {}
},
ready: function () {
this.trainee = TrainRemote.trainee;
}
});
@mattstauffer
mattstauffer / env.helper.php
Created November 22, 2015 00:01
Laravel's 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
mattstauffer / gist:a2376484ea2e19325e3c
Last active March 5, 2020 21:19 — forked from rtablada/gist:dcf0f82d8ca4c914fd9b
Something something node modules something

(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 Socket.io 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
mattstauffer / blog.md
Last active November 13, 2021 10:46
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 http://gistlog.co/your-user-name. So, since I have (more than) one, you can view my landing page at gistlog.co/mattstauffer. 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 blog.md for the name) and one for the Gistlog settings (which must be named gistlog.yml)
  3. Write your blog post in blog.md
  4. Since there are no actual settings being parsed from gistlog.yml yet, just create it with the fol
@mattstauffer
mattstauffer / blog.md
Last active June 23, 2021 01:18
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
mattstauffer / blog.md
Last active August 29, 2015 14:16
First Blog Post with Gistlog.yml

Publish me bro

@mattstauffer
mattstauffer / log.md
Last active June 14, 2023 09:23
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 https://gistlog.co/your-github-username/gist-id
  4. If you want to have your own GistLog landing page (e.g. gistlog.co/mattstauffer), [read all about it](https://gistlog.co/mattstauffer/a82db5
@mattstauffer
mattstauffer / api-changes.md
Last active August 29, 2015 14:13
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.

Auth

Cache

@mattstauffer
mattstauffer / request-for-comments.md
Last active January 11, 2018 02:01
Comments for my Upgrading Laravel 4 to Laravel 5 post

Please note any missing pieces, wrong directions, or anything else in the comments. Thanks!

This is trying to catch all framework-related changes that are missing from my post RE upgrading Laravel 4 to 5.