Skip to content

Instantly share code, notes, and snippets.

@akoepcke
akoepcke / LocalValetDriver.php
Created May 28, 2024 08:47 — forked from simonhamp/LocalValetDriver.php
Run anything you like through Laravel Herd
<?php
use Valet\Drivers\ValetDriver;
class LocalValetDriver extends ValetDriver
{
public function serves(string $sitePath, string $siteName, string $uri): bool
{
return true;
}
@akoepcke
akoepcke / tailwind.config.ts
Created July 17, 2023 16:49 — forked from jordienr/tailwind.config.ts
Tailwind SVG Grid Background
// Remember to install mini-svg-data-uri
// Follow me on twitter for memes @jordienr
import { type Config } from "tailwindcss";
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette");
const svgToDataUri = require("mini-svg-data-uri");
export default {

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by
@akoepcke
akoepcke / next.config.js
Created April 23, 2023 13:31 — forked from mdubourg001/next.config.js
Next.js - Force the creation of an index.html file for every page
module.exports = {
// forcing the creation of an index.html for every page to allow
// providers serving pages without having to add .html to the url
exportPathMap: async function (defaultPathMap) {
const pathMap = {};
for (const [path, config] of Object.entries(defaultPathMap)) {
if (path === "/") {
pathMap[path] = config;
} else {
<?php
namespace App\Traits;
use Carbon\Carbon;
trait FilterableByDates
{
public function scopeToday($query, $column = 'created_at')
{
@akoepcke
akoepcke / placeholder-image.js
Created March 1, 2023 09:44 — forked from stowball/placeholder-image.js
Placeholder React Components
function PlaceholderImage({
height,
width,
...consumerProps
}) {
return (
<img
{...consumerProps}
alt=""
src={`https://via.placeholder.com/${width}x${height}`}
@akoepcke
akoepcke / package.json
Created January 4, 2023 17:01
Astro relative base path
{
...
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"postbuild": "node ./postbuild.mjs -path ./",
"preview": "astro preview",
"astro": "astro"
},
const Test = () => {
return
(
<>
<div className="absolute top-0 right-0 p-4 text-right bg-white">
ref: {swipeRef.current?.clientHeight}
<br />
availHeight: {window.screen.availHeight}
<br />
innerHeight: {window.innerHeight}
@akoepcke
akoepcke / Envoy.blade.php
Last active November 26, 2021 12:10
Deploy Laravel with Envoy
@servers(['web' => ['user@my-server.com']])
@setup
$env = isset($env) ? $env : 'dev';
if ($env === 'dev') {
$dir = '/var/www/html/dev/my-laravel-app';
} else if ($env === 'production') {
$dir = '/var/www/html/my-laravel-app';
}