#!/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
// 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
// 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
<?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
// 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\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
#!/usr/bin/env swift | |
import Foundation | |
let df = DateFormatter() | |
df.locale = Locale(identifier: "en_US") | |
df.timeZone = TimeZone(identifier: "Antarctica/Casey") | |
df.setLocalizedDateFormatFromTemplate("zzzz") | |
print("\(String(describing: df.timeZone))") | |
print(df.string(from: Date())) |
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
const mix = require("laravel-mix") | |
mix.site = (id, callback) => { | |
if (!process.env.SITE || process.env.SITE === id) { | |
return callback() | |
} | |
}; | |
mix.site('admin', () => { | |
mix.js("resources/js/admin/app.js", "public/js/admin.js") |
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
Show hidden characters
// If you're using typescript or ts-check you can alias the composition api package as well: | |
{ | |
"compilerOptions": { | |
// … other stuff omitted for brevity … | |
// Ensure your base url is set | |
"baseUrl": ".", | |
"paths": { | |
// Add composition API to your compiler options and alias it to the vue 3 install | |
// The path is relative to `baseUrl` above |
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
import { createApp, configureCompat } from "vue" | |
configureCompat({ MODE: 3 }) | |
const app = createApp({ | |
setup() { | |
return { | |
// stuff | |
} | |
} |