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 | |
namespace App\Support; | |
use Illuminate\Session\Store; | |
use RuntimeException; | |
/** | |
* Helper class that transforms all sessions into a specific key. | |
* |
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 memoize($target) { | |
static $memo = new WeakMap; | |
return new class ($target, $memo) { | |
function __construct( | |
protected $target, | |
protected &$memo, | |
) {} |
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 passwordInput = document.getElementById('password'); | |
passwordInput.addEventListener('keyup', function (event) { | |
if (event.getModifierState('CapsLock')) { | |
// CapsLock is open | |
} | |
}); |
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
<IfModule mod_headers.c> | |
<IfModule mod_rewrite.c> | |
# Turn on the rewrite engine (this is necessary in order for | |
# the `RewriteRule` directives to work). | |
# | |
# https://httpd.apache.org/docs/current/mod/core.html#options | |
RewriteEngine On |
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
@props(['key' => null]) | |
@if((bool) $key) | |
<!-- Google Tag Manager (noscript) --> | |
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ $key }}" | |
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> | |
<!-- End Google Tag Manager (noscript) --> | |
@endif |
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 | |
namespace {{ factoryNamespace }}; | |
use Illuminate\Database\Eloquent\Factories\Factory; | |
use {{ namespacedModel }}; | |
/** | |
* @method {{ model }}|\Illuminate\Support\Collection<{{ model }}> create($attributes = [], ?Model $parent = null) | |
* @method \Illuminate\Support\Collection<{{ model }}> createMany(iterable $records) |
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
function toggleable(id) { | |
return { | |
id: id, | |
show: false, | |
bodyNeedsOverflowHidden: false, | |
originalOverflow: '', | |
id() { | |
return id || `toggleable-${Math.random().toString(36).substr(2, 10)}` | |
}, |
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 = plugin(function ({ addBase, theme }) { | |
addBase({ | |
':root': { | |
'--rf-min-fs': theme('responsive-font.min-fs'), | |
'--rf-max-fs': theme('responsive-font.max-fs'), | |
'--rf-min-vw': theme('responsive-font.min-vw'), | |
'--rf-max-vw': theme('responsive-font.max-vw'), | |
'--rf-min-fs-rem': 'var(--rf-min-fs) * 1rem', |
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
export default class RestJson { | |
constructor(endpoint, options = {}) { | |
if (!window.fetch) { | |
console.error("Sorry you cannot use RestJson Class, your browser doesn't support Fetch API."); | |
console.error("Please try with another browser or update it to a new version."); | |
} | |
const defaultOptions = { | |
headers: {'Content-Type': 'application/json'} | |
}; |
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
@props(['src']) | |
<!-- | |
- 1. Preemptively warm up the fonts’ origin. | |
- | |
- 2. Initiate a high-priority, asynchronous fetch for the CSS file. Works in | |
- most modern browsers. | |
- | |
- 3. Initiate a low-priority, asynchronous fetch that gets applied to the page | |
- only after it’s arrived. Works in all browsers with JavaScript enabled. |
NewerOlder