A Pen by Yoshihide Jimbo on CodePen.
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
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; | |
} |
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
// 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)) { |
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
// 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) { |
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
Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function. |
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
{ | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"rules": [ | |
{ | |
"description": "Toggle input source (English or Japanese) by kana key (available since Karabiner-Elements 11.1.8)", | |
"manipulators": [ | |
{ | |
"conditions": [ |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"outDir": "./dist/", | |
"sourceMap": true, | |
"noImplicitAny": true, | |
"strictNullChecks": true, | |
"removeComments": true, | |
"module": "commonjs", | |
"target": "es5", | |
"jsx": "react" |
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
root = true | |
[*] | |
end_of_line = lf | |
insert_final_newline = true | |
charset = utf-8 | |
indent_style = space | |
indent_size = 2 | |
trim_trailing_whitespace = true |
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
# 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. # 元に戻ってしまう |
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
#!/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 |
NewerOlder