Skip to content

Instantly share code, notes, and snippets.

View MattWohler's full-sized avatar

Matt Wohler MattWohler

View GitHub Profile
@MattWohler
MattWohler / aliases
Last active August 8, 2016 10:50
bash aliases
# Easier navigation: .., ..., ...., ....., ~ and -
alias ..="cd .."
alias ...="cd ../.."
# Shortcuts
alias dl="cd ~/Downloads"
alias dt="cd ~/Desktop"
alias h="history"
# Detect which `ls` flavor is in use
[core]
autocrlf = true
excludesfile = C:\\Users\\m_wohler\\Documents\\gitignore_global.txt
[user]
name = Matt Wohler
email = [email protected]
[alias]
pu = pull
pr = pull --rebase
rb = rebase
@MattWohler
MattWohler / TokenGuard.md
Last active January 31, 2016 22:53
Laravel 5.2: Authentication Guard API Token

Laravel 5.2: Authentication Guard API Token

Recently, Jacob Bennett beat me to the punch when after much digging, came to the realization that I needed to utilize Laravel's Token Guard, yet there were no resources to be found on implementing such feature as the Laravel Documentation leaves much to be desired.

I highly recommend you take a look at Jacob's API Token Authentication in Laravel 5.2 article, as it provides great insight onto the subject, as well as an active discussion in the comment section.

However, there is a variation on the popular suggestion, as in the case of my implementation.

For the setup, I wanted a custom HTTP Header with key to be sent on every request for authentication.

@MattWohler
MattWohler / setting-up-ssh-keys.md
Last active March 10, 2016 07:52
How To Set Up SSH Keys

How To Set Up SSH Keys

Step One—Create the RSA Key Pair

Create the key pair on the client machine:

ssh-keygen -t rsa

Step Two—Copy the Public Key

Once the key pair is generated, place the public key on the virtual server:

@MattWohler
MattWohler / stickstyles.css
Created June 7, 2017 21:23
Sticky Footer Styles
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}

Taylor Otwell : Yeah, so at first, I had no intentions of splitting off and writing a framework. But you're right, one of the first projects I wrote was CI injector, CInject or something like that. I was actually pretty proud of that. It was actually the first reflection-based IOC container in PHP at all that I'm aware of. There was one other IOC container that was also written in 2010, a few months later. That was one of the main pieces of .NET/.MVC that I really like was the auto-resolving container. Laravel's container still works, basically, like that first CodeIgniter container did. The other thing I was really interested in was the better ORM for CodeIgniter, and I wanted to get those two things in ... oh, there was a third thing.

I wanted better templating, like Blade, where you have an @extends at the top, and then you define these sections that override the parent template section, stuff like that. Template inheritance. I remember the final straw, that I couldn't really continue with CodeIgniter any

@MattWohler
MattWohler / FormRequest.php
Created May 6, 2018 17:31
Support\FormRequest
<?php
namespace HCI\Support\Http;
use Illuminate\Foundation\Http\FormRequest as BaseFormRequest;
abstract class FormRequest extends BaseFormRequest
{
/**
* Determine if the user is authorized to make this request.
eyJ2ZXJzaW9uIjoxLjMsImZlYXR1cmVzIjp7ImxvY2F0aW9uIjp7InJvb20iOnRydWUsIm91dHNpZGUiOnRydWUsIndvcmxkIjp0cnVlfX0sInN0b3JlcyI6eyJ3b29kIjoyOTY1LCJmdXIiOjE5NzUsImJhaXQiOjI4NywibWVhdCI6MTYxMCwidGVldGgiOjE2Niwic2NhbGVzIjoxMTYsImNsb3RoIjo1MiwiY3VyZWQgbWVhdCI6MTE3NCwibGVhdGhlciI6NjYyLCJjaGFybSI6MCwidG9yY2giOjEzLCJib25lIHNwZWFyIjo0LCJ3YXRlcnNraW4iOjEsInJ1Y2tzYWNrIjoxLCJsIGFybW91ciI6MSwiY29tcGFzcyI6MX0sImNoYXJhY3RlciI6eyJzdGFydmVkIjoyfSwiaW5jb21lIjp7ImdhdGhlcmVyIjp7ImRlbGF5IjoxMCwic3RvcmVzIjp7Indvb2QiOjR9LCJ0aW1lTGVmdCI6OX0sImJ1aWxkZXIiOnsiZGVsYXkiOjEwLCJzdG9yZXMiOnsid29vZCI6Mn0sInRpbWVMZWZ0IjozfSwiaHVudGVyIjp7ImRlbGF5IjoxMCwic3RvcmVzIjp7ImZ1ciI6MzcuNSwibWVhdCI6MzcuNX0sInRpbWVMZWZ0Ijo0fSwidHJhcHBlciI6eyJkZWxheSI6MTAsInN0b3JlcyI6eyJtZWF0IjowLCJiYWl0IjowfSwidGltZUxlZnQiOjR9LCJjaGFyY3V0aWVyIjp7ImRlbGF5IjoxMCwic3RvcmVzIjp7Im1lYXQiOi01LCJ3b29kIjotNSwiY3VyZWQgbWVhdCI6MX0sInRpbWVMZWZ0IjoxMH0sInRhbm5lciI6eyJkZWxheSI6MTAsInN0b3JlcyI6eyJmdXIiOjAsImxlYXRoZXIiOjB9LCJ0aW1lTGVmdCI6NH19LCJ0aW1lcnMiOnt9LCJnYW1lIjp7ImJ1aWxkZXIiOnsibGV2ZWwi