PwgXqX
A Pen by Yoshihide Jimbo on CodePen.
import { Transformer } from 'unified'; | |
import { Element } from 'hast'; | |
import { visit } from 'unist-util-visit'; | |
export default function rehypeRemoveStyleAttrs(): Transformer { | |
return (tree) => { | |
visit(tree, 'element', (node: Element) => { | |
if (node.properties?.style) { | |
node.properties.style = undefined; | |
} |
// https://letsbuildui.dev/articles/building-a-dropdown-menu-component-with-react-hooks | |
import { useState, useEffect, RefObject } from 'react'; | |
export const useDetectOutsideClick = (ref: RefObject<HTMLElement>, initialState: boolean) => { | |
const [isActive, setIsActive] = useState(initialState); | |
useEffect(() => { | |
const pageClickEvent = (event: MouseEvent) => { | |
// If the active element exists and is clicked outside of | |
if (ref.current !== null && !ref.current.contains(event.target as Node)) { |
// https://www.netlify.com/blog/2017/07/18/http/2-server-push-on-netlify/ | |
const debug = require('debug')('nuxt:netlify-http2-server-push'); | |
const path = require('path'); | |
const glob = require('glob'); | |
const fs = require('fs'); | |
module.exports = function module(moduleOptions) { | |
// This module is only enabled on production builds | |
if (this.options.dev) { |
Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function. |
{ | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"rules": [ | |
{ | |
"description": "Toggle input source (English or Japanese) by kana key (available since Karabiner-Elements 11.1.8)", | |
"manipulators": [ | |
{ | |
"conditions": [ |
{ | |
"compilerOptions": { | |
"outDir": "./dist/", | |
"sourceMap": true, | |
"noImplicitAny": true, | |
"strictNullChecks": true, | |
"removeComments": true, | |
"module": "commonjs", | |
"target": "es5", | |
"jsx": "react" |
root = true | |
[*] | |
end_of_line = lf | |
insert_final_newline = true | |
charset = utf-8 | |
indent_style = space | |
indent_size = 2 | |
trim_trailing_whitespace = true |
# 1回目 | |
$ patch --batch -p0 -i xxx.patch | |
patching file node_modules/foo/bar/xxx | |
# 2回目 | |
$ patch --batch -p0 -i xxx.patch | |
patching file node_modules/foo/bar/xxx | |
Reversed (or previously applied) patch detected! Assuming -R. # 元に戻ってしまう |
A Pen by Yoshihide Jimbo on CodePen.
#!/usr/bin/env bash | |
# Check that terminfo exists before changing TERM var to xterm-256color | |
# Prevents prompt flashing in Mac OS X 10.6 Terminal.app | |
if [ -e /usr/share/terminfo/x/xterm-256color ]; then | |
export TERM='xterm-256color' | |
fi | |
# Turn off standout; turn off underline | |
tput sgr 0 0 |