Skip to content

Instantly share code, notes, and snippets.

View kreo's full-sized avatar
:electron:
System Failture. Try again🁢

Fabio Cencetti kreo

:electron:
System Failture. Try again🁢
View GitHub Profile
@leifericf
leifericf / install-java-macos.md
Last active June 3, 2024 16:14
Installing Java on macOS and Adding It to jEnv

Install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install jEnv using Homebrew:

brew install jenv

Add the cask-versions tap to Homebrew:

@kreo
kreo / css-ios-pwa-viewport.css
Created January 28, 2022 16:18 — forked from cvan/css-ios-pwa-viewport.css
CSS for env(safe-area-inset-top) for iOS "Add to Homescreen" / PWA; standalone styles
@supports (padding-top: constant(safe-area-inset-top)) {
body {
padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
}
@media (display-mode: fullscreen) {
body {
padding: 0;
}
@leon
leon / README.md
Last active April 21, 2023 07:04
NX tailwind 3 setup

Tailwind 3 has jit mode and purge built in.

So we only need to specify a list of globs to the content prop of the tailwind.config.js

@nrwl/workspace contains a function called createGlobPatternsForDependencies which can generate an array of globs that you can pass to tailwind.

import { h, hydrate } from 'preact';
let C = 0;
export function Root({ href, data, children }) {
let json = data && JSON.stringify(data);
let id = 'root:'+++C;
return [
h(`!--${id}--`),
children,
h('component-root', { href, id },
@kreo
kreo / example-input.html
Created July 29, 2021 17:11 — forked from stowball/example-input.html
Fetch a remote SVG as an <img> and convert it to an inline SVG
<img
alt="accessible text"
class="fill-color-red"
height="16"
src="some.svg"
width="16"
onload="fetchSvgInline(this)"
/>
@mashirozx
mashirozx / _polyfill.scss
Last active March 13, 2024 08:23
Flex box gap polyfill with scss mixin
@use 'sass:math';
@mixin _flex-gap($gap, $row: true) {
$margin: math.div($gap, 2);
$transform: -$margin;
@if $row {
margin-left: $transform;
margin-right: $transform;
} @else {
margin-top: $transform;
margin-bottom: $transform;
@devpato
devpato / webpack.config.js
Created February 11, 2021 06:28
webpack.config.js
const { addTailwindPlugin } = require("@ngneat/tailwind");
const tailwindConfig = require("./tailwind.config.js");
module.exports = (config) => {
addTailwindPlugin({
webpackConfig: config,
tailwindConfig,
patchComponentsStyles: true
});
return config;
@devpato
devpato / tailwind.config.js
Last active July 14, 2021 08:04
tailwind.config.js
module.exports = {
prefix: '',
purge: {
content: [
'./src/**/*.{html,ts}',
]
},
darkMode: 'class', // or 'media' or 'class'
theme: {
extend: {},
/**
* Usage:
* class FancyButton extends HTMLElement {
* constructor() {
* super();
* ensureShadowRoot(el);
* // if a declarative shadow root was present, it'll be here:
* console.log(this.shadowRoot);
* }
* }
if (!Element.prototype.getInnerHTML) {
Element.prototype.getInnerHTML = function(opts) {
var html = this.innerHTML;
if (!opts || !opts.includeShadowRoots) return html;
var m = new (self.WeakMap || Map)();
for (var c of (opts.closedRoots || [])) m.set(c.host, c);
var p = [];
function walk(node) {
var c, shadow = node.shadowRoot || m.get(node);
if (shadow) p.push(node.innerHTML, `<template shadowroot="${shadow.mode}">${shadow.innerHTML}</template>`);