Skip to content

Instantly share code, notes, and snippets.

<template>
<svg>
<use :href="symbolId" />
</svg>
</template>
<script>
export default {
props: ['icon'],
<template>
<svg v-bind="svgAttributes" v-html="svgContent"></svg>
</template>
<script>
export default {
props: ['icon'],
data() {
return {
<template>
<svg
v-bind="svgAttributes"
v-html="svgContent"
>
</svg>
</template>
<script>
export default {
@danielstgt
danielstgt / app.css
Created February 11, 2022 09:22
CSS Home Bar Padding (Tailwind CSS)
@layer utilities {
.pb-safe {
padding-bottom: env(safe-area-inset-bottom);
}
}
@danielstgt
danielstgt / readme.md
Created February 4, 2022 19:03
Useful Redirect Headers

Useful Redirect Headers

Set a max age

Cache-Control: max-age=3600

The max-age=N response directive indicates that the response remains fresh until N seconds after the response is generated.

@danielstgt
danielstgt / AppServiceProvider.php
Created January 12, 2022 08:43
DB Query Logging with Laravel
namespace App\Providers;
use DB;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
{
"rules": {
"@PSR2": true,
"ordered_imports": {
"sort_algorithm": "length"
},
"array_syntax": {
"syntax": "short"
},
"no_unused_imports": true,
@danielstgt
danielstgt / app.css
Created December 25, 2021 02:01
CSS text rendering based on hover detection
/* is not a touch device */
@media (hover: hover) {
body { text-rendering: optimizeLegibility; }
}
/* is a touch device */
@media (hover: none) {
body { text-rendering: optimizeSpeed; }
}
@danielstgt
danielstgt / README.md
Last active November 29, 2021 13:30
Tailwind CSS JavaScript Modifier/Variant

Usage

Use a js or no-js variant depending on the availability of JavaScript, e.g. no-js:hidden or js:bg-blue-500.

Tailwind CSS Config

const plugin = require('tailwindcss/plugin');

module.exports = {
@danielstgt
danielstgt / .env
Last active October 29, 2021 14:10
Create a debug only alias for console.log
MIX_JS_DEBUG="${APP_DEBUG}"