Skip to content

Instantly share code, notes, and snippets.

View mattstauffer's full-sized avatar

Matt Stauffer mattstauffer

View GitHub Profile
@mattstauffer
mattstauffer / oauth-app-management.md
Created June 11, 2019 17:39
Where are all the oauth app configs for all the major services?
@mattstauffer
mattstauffer / navigation.php
Last active January 24, 2019 16:27
Possible structure for tailwind nav
<?php
return [
'Installation' => [
'Installation' => 'installation',
'Configuration' => 'configuration',
'Colors' => 'colors',
'Responsive Design' => 'responsive-design',
'Adding New Utilities' => 'adding-new-utilities',
'Extracting Components' => 'extracting-components',
@mattstauffer
mattstauffer / blog.md
Last active January 24, 2019 09:00
Hacktoberfest 2017 for Tighten

Hacktoberfest logo

Every year Digital Ocean runs Hacktoberfest, which is a fun program that rewards developers for making pull requests to open source software. This year you could get stickers and a free t-shirt for participating!

Looking for some code you can write on Laravel-related applications for Hacktoberfest? Here are a few issues we have open. :)

Collect

  • Test the automatic-split tester called "Collector" to see if we can move to doing automatic splits per #2

Symposium

@mattstauffer
mattstauffer / makepost.sh
Created September 5, 2017 01:02
My build script for creating a new Jigsaw post
#!/bin/bash
function slugify {
echo "$1" | iconv -t ascii//TRANSLIT | sed -E s/[^a-zA-Z0-9]+/-/g | sed -E s/^-+\|-+$//g | tr A-Z a-z
}
# -------------------------------
echo
echo Creating a new blog post.

Keybase proof

I hereby claim:

  • I am mattstauffer on github.
  • I am mattstauffer (https://keybase.io/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
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