Skip to content

Instantly share code, notes, and snippets.

View amoutonbrady's full-sized avatar
🇸🇪
Dreaming

Alexandre amoutonbrady

🇸🇪
Dreaming
View GitHub Profile
import { createContext, createState, createComputed, onMount, onCleanup, splitProps, useContext, mergeProps } from "solid-js";
import { isServer, Show, Portal, Dynamic } from "solid-js/web";
const MetaContext = createContext();
const cascadingTags = ["title", "meta"];
const MetaProvider = props => {
const indices = new Map(), [state, setState] = createState({});
onMount(() => {
const ssrTags = document.head.querySelectorAll(`[data-sm=""]`);
// `forEach` on `NodeList` is not supported in Googlebot, so use a workaround
Array.prototype.forEach.call(ssrTags, (ssrTag) => ssrTag.parentNode.removeChild(ssrTag));
@amoutonbrady
amoutonbrady / remove_ts.md
Created November 3, 2018 21:04
Regex to remove tsc --init default config comments
  1. Go into VSCode
  2. Install typescript npm i typescriptfor local OR npm i -g typescript for global
  3. Run either node_modules/.bin/tsc --init for local installation or tsc --init for global
  4. Open the generated file tsconfig.json and press CTRL+F
  5. Make sure to tick the regex filter for search on the far right of the search input (third icon)
  6. Pase that regex \s* \/\* .* \*\/
  7. Replace by "nothing"