#!/usr/bin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Logs\Sticky; | |
use Illuminate\Log\Logger; | |
class AttachContext | |
{ | |
public function __invoke(Logger $logger) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prefix all Tailwind UI classes with "tw-" | |
// Works as of 2020-04-25 | |
// Examples: | |
// mx-4 -> tw-mx-4 | |
// -mx-4 -> tw--mx-4 | |
// lg:mx-4 -> lg:tw-mx-4 | |
// lg:-mx-4 -> lg:tw--mx-4 | |
const prefix = "tw-" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Database\Eloquent\Collection; | |
class ParentChildHierarchy | |
{ | |
public static function apply($entities, $primaryKey = "id", $parentKey = "parent_id", $parentRelation = "parent", $childRelation = "children") | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Build two webpack configs | |
mix.build(mix => { | |
mix.js('resources/js/site1/app.js', 'public/js/site1.js') | |
mix.sass('resources/sass/site1/app.scss', 'public/css/site1.css') | |
}) | |
mix.build(mix => { | |
mix.js('resources/js/site2/app.js', 'public/js/site2.js') | |
mix.sass('resources/sass/site2/app.scss', 'public/css/site2.css') | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Why? | |
// Figma (as of this writing) doesn't have color management | |
// As a result of this when using hex values intended for sRGB the colors end up much richer on a P3 display | |
// If you throw them into a color managed browser you're not going to get what you expect. It'll look washed out. | |
// This is a best approximation of the colors by interpeting as Display P3 and converting to sRGB | |
// Some colors are not fully representable (and are marked as such by noting which channels were clipped) | |
// h/t to Marc Edwards for pointing me in the right direction on how to do this. Thanks! | |
import Cocoa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== RUN TestNextToken | |
=== RUN TestNextToken/{,} | |
=== RUN TestNextToken/{a,} | |
=== RUN TestNextToken/{ab,c} | |
=== RUN TestNextToken/{1..10} | |
=== RUN TestNextToken/{1...10} | |
panic: runtime error: slice bounds out of range [recovered] | |
panic: runtime error: slice bounds out of range | |
goroutine 24 [running]: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Fetch\Server; | |
// https://github.com/tedious/Fetch | |
$server = new Server("outlook.office365.com", 993); | |
$server->setAuthentication("[email protected]", "mypassword"); | |
$server->setFlag("novalidate-cert"); | |
$server->setParam("DISABLE_AUTHENTICATOR", ["PLAIN"]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"workbench.colorCustomizations": { | |
"terminalCursor.foreground": "#fee381", | |
"terminal.selectionBackground": "#cb392e", | |
"terminal.background": "#0d151b", | |
"terminal.foreground": "#ffffff", | |
"terminal.ansiBlack": "#3c444d", | |
"terminal.ansiBlue": "#266b85", | |
"terminal.ansiBrightBlack": "#515d68", | |
"terminal.ansiBrightBlue": "#329dcc", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Combinations | |
{ | |
public static function unique($values, $minLength = 1, $maxLength = null) | |
{ | |
// $combinations is an array of [["a"], ["a"], … ["a", "b"], ["a", "b", "c"], …] | |
// The array may not be sorted. Each internal array IS sorted. | |
// Keys produced by the generator are sequential but shouldn't matter |