This file contains 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 bash | |
# many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos | |
# many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac | |
# instructions on finding the default you've changed: https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/ | |
# previous install notes at: | |
# https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3 | |
# https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70 | |
# https://gist.github.com/llimllib/3fc4fefcfc0152dad8c58201246d8802 | |
# | |
# this script's URL is: https://gist.github.com/llimllib/c4dd0a98a426022b0365d4c0a9090460 |
This file contains 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 plugin = require("tailwindcss/plugin"); | |
module.exports = { | |
mode: "jit", | |
purge: { | |
content: ["./src/**/*.{js,ts,jsx,tsx,mdx,vue}"], | |
}, | |
theme: { extend: {} }, | |
variants: {}, | |
plugins: [ |
This file contains 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
When setting up a Mastodon instance I had a very hard time working out the required S3 permissions. | |
Wasted a day on it. None of the tutorials or even the official documentation gave me this information. | |
In the end I gave up and just gave it blanket access to all permissions for the Mastodon bucket (S3Administrator). | |
But this didn't set well with me - I don't like granting unnecessary permissions, especially not when S3 has about 100 of them. | |
If the server were to become compromised or the keys were to otherwise fall into the wrong hands I'd want a potentially malicious actor to have as limited permissions as possible. | |
Anyway I finally worked out the permissions required to for Mastodon to function with an S3 bucket as its media storage. | |
See below for the IAM policy. |
This file contains 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
opendb () { | |
[ ! -f .env ] && { echo "No .env file found."; exit 1; } | |
DB_CONNECTION=$(grep DB_CONNECTION .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
DB_HOST=$(grep DB_HOST .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
DB_PORT=$(grep DB_PORT .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
DB_DATABASE=$(grep DB_DATABASE .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
DB_USERNAME=$(grep DB_USERNAME .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) | |
DB_PASSWORD=$(grep DB_PASSWORD .env | grep -v -e '^\s*#' | cut -d '=' -f 2-) |
This file contains 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 | |
// Register these inside a service provider: | |
Blade::directive('route', function ($expression) { | |
return "<?php echo route({$expression}) ?>"; | |
}); | |
Blade::directive('routeIs', function ($expression) { | |
return "<?php if (request()->routeIs({$expression})) : ?>"; |
This file contains 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 python | |
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
RUN_PATH = '/Applications/Tinkerwell.app' | |
def process_args(argv): | |
args = [] |
This file contains 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
<div class="flex items-center m-2 fixed bottom-0 right-0 border border-gray-400 rounded p-2 bg-gray-300 text-pink-600 text-sm"> | |
<svg class="h-6 w-auto inline" viewBox="0 0 80 64" fill="none" xmlns="http://www.w3.org/2000/svg"> | |
<path fill="url(#paint0_linear)" fill-rule="evenodd" clip-rule="evenodd" d="M32 16C24.8 16 20.3 19.6 18.5 26.8C21.2 23.2 24.35 21.85 27.95 22.75C30.004 23.2635 31.4721 24.7536 33.0971 26.4031C35.7443 29.0901 38.8081 32.2 45.5 32.2C52.7 32.2 57.2 28.6 59 21.4C56.3 25 53.15 26.35 49.55 25.45C47.496 24.9365 46.0279 23.4464 44.4029 21.7969C41.7557 19.1099 38.6919 16 32 16ZM18.5 32.2C11.3 32.2 6.8 35.8 5 43C7.7 39.4 10.85 38.05 14.45 38.95C16.504 39.4635 17.9721 40.9536 19.5971 42.6031C22.2443 45.2901 25.3081 48.4 32 48.4C39.2 48.4 43.7 44.8 45.5 37.6C42.8 41.2 39.65 42.55 36.05 41.65C33.996 41.1365 32.5279 39.6464 30.9029 37.9969C28.2557 35.3099 25.1919 32.2 18.5 32.2Z"></path> | |
<defs> | |
<linearGradient id="paint0_linear" x1="3.5" y1="16" x2="59" y2="48" gradien |
This file contains 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 PhpCsFixer\Config; | |
use PhpCsFixer\Finder; | |
$rules = [ | |
'array_indentation' => true, | |
'array_syntax' => ['syntax' => 'short'], | |
'binary_operator_spaces' => [ | |
'default' => 'single_space', |
This file contains 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 | |
function sunIsUp(\DateTime $when, $lat, $lon): bool { | |
$whenTimestamp = $when->getTimestamp(); | |
$sunriseTimestamp = date_sunrise( | |
$whenTimestamp, | |
SUNFUNCS_RET_TIMESTAMP, | |
$lat, | |
$lon |
This file contains 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
func scrollToSection(_ section: Int) { | |
if let collectionView = collectionView { | |
let indexPath = IndexPath(item: 0, section: section) | |
if | |
let attributes = collectionView.layoutAttributesForItem(at: indexPath), | |
let flowLayout = collectionView.collectionViewLayout as? FlowLayout | |
{ | |
let headerHeight = flowLayout.headerReferenceSize | |
let topSectionInset = flowLayout.sectionInset.top |
NewerOlder