Skip to content

Instantly share code, notes, and snippets.

@Lelectrolux
Lelectrolux / README.md
Last active January 9, 2020 08:13
Basic requiredwith support in HTML/JavaScript
<form>
  <input name="foo" id="foo">
  <input name="bar" id="bar" requiredwith="foo,baz">
  <input name="baz" id="baz">
</form>

Simply add a comma separated list of ids of inputs.

Hooks into native required support, so as is, it won't display a more specialised error message than the default required one.

export default {
render () {},
mounted () {
Object.keys(this.$listeners)
.foreach(event => {
window.addEventListener(event, this.$listeners[event])
})
},
.wrapper {
--gap: 32px;
display: grid;
grid-column-gap: var(--gap);
grid-template-columns: 1fr min(65ch, calc(100% - 2 * var(--gap))) 1fr;
}
.wrapper > * {
grid-column: 2;
}
@Lelectrolux
Lelectrolux / responsive-menu.html
Created January 6, 2021 18:07 — forked from Akryum/responsive-menu.html
Tailwind negate responsive breakpoints
<div class="flex !md:flex-col items-center !md:space-y-6 md:space-x-6">
<button>Menu button 1</button>
<button>Menu button 2</button>
<button>Menu button 3</button>
</div>
@Lelectrolux
Lelectrolux / index.html
Created March 26, 2022 21:54
Alpine.js + Tailwind CSS prototype starter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Prototype</title>
<!-- https://tailwindcss.com/docs/installation -->
<script src="https://cdn.tailwindcss.com" defer></script>
@Lelectrolux
Lelectrolux / bootstrap-app.php
Created July 16, 2025 14:26
Add Laravel exception context
<?php
//
$exceptions->context(function (Throwable $e, array $context) {
try {
if (app()->runningUnitTests()) {
$context['isRunningTest'] ??= true;
}
if (app()->runningInConsole()) {
$context['runningIn'] ??= 'console';