Skip to content

Instantly share code, notes, and snippets.

View sixlive's full-sized avatar

TJ Miller sixlive

View GitHub Profile
@sixlive
sixlive / 0.POST.md
Last active August 29, 2017 12:49
Basic Resource Response Example

Here is a brief example/preview of the new Laravel 5.5 resource responses. Taylor will be going into much greater detail about this at the Laracon EU conference (2017).

Resource Response

{
  "data": {
    "id": "0b1a798c-7e7e-46d1-8c4c-0c786730d36f",
    "name": null,
    "status": "Ready"
@sixlive
sixlive / 0.POST.md
Last active August 31, 2017 19:40
Stackable Command Output

This is a little trait I use to stack output over the course of a command and display all the output at the end.

trait StackableOutput
{
    protected $stackedOutput = [];

    private function stackOutput($content, $type = 'line')
    {
 array_push($this->stackedOutput, [
@sixlive
sixlive / 0.POST.md
Last active August 9, 2022 20:40
My Current PHP CS Fixer Workflow

This is the process and standard that I use for the vast majority of my Laravel code bases and projects.

For more information about php-cs-fixer visit the project repository: FriendsOfPHP/PHP-CS-FIXER.

Setup

Add the following .php_cs file to the root of your project.

.php_cs

@sixlive
sixlive / init.lua
Created February 13, 2024 13:14
Window sizes
-- Define the map of applications and their default sizes
local appSizeMap = {
["Telegram"] = {{w=470, h=900}, {w=1160, h=710}},
["Todoist"] = {{w=635, h=920}, {w=1115, h=760}},
["Slack"] = {{w=1300, h=780}, {w=980, h=670}},
["WezTerm"] = {w=1357, h=920}
}
-- Store the current index of the size for each application
local appSizeIndex = {}
@sixlive
sixlive / 0.demo.gif
Last active March 23, 2024 14:39
An interactive way to search pull requests and check them out
0.demo.gif
#!/usr/bin/env bash
script_name="$(basename "$0")"
_verify_dependencies() {
_print_err() {
printf "[$SCRIPT_NAME] \033[31m%s\033[0m\n" "$1"
}
if ! command -v gum &>/dev/null; then