This file contains hidden or 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
.modal { | |
--transition: all 400ms allow-discrete; | |
margin: auto; /* override resets */ | |
background: transparent; /* styling is the content responsiblity */ | |
min-width: clamp(320px, 60ch, 100vw); /* keep sensible widths */ | |
opacity: 0; | |
transition: var(--transition); |
This file contains hidden or 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
[*] | |
charset = utf-8 | |
insert_final_newline = true | |
end_of_line = lf | |
indent_style = space | |
indent_size = 2 | |
max_line_length = 120 |
This file contains hidden or 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
const getErrorMessage = (response?: Response): string => { | |
const fallbackMsg = 'an unknown error'; | |
if (!response) { | |
return fallbackMsg; | |
} | |
const code = typeof response.status === 'number' ? response.status : ''; | |
const status = `${code} ${response.statusText || ''}`.trim(); | |
return status ? `status code ${status}` : fallbackMsg; |
This file contains hidden or 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
version: 2 | |
updates: | |
- package-ecosystem: npm | |
directory: / | |
schedule: | |
interval: weekly | |
day: "saturday" | |
time: "08:00" | |
groups: | |
patches: |
This file contains hidden or 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 { render as renderComponent } from '@testing-library/react'; | |
import userEvent from '@testing-library/user-event'; | |
type RenderArgs = Parameters<typeof renderComponent>; | |
export * from '@testing-library/react'; | |
/** | |
* Augments the RTL render with a userEvent user | |
*/ |
This file contains hidden or 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
#!/bin/bash | |
touch temp.text | |
lsof -n -i4TCP:$1 | awk '{print $2}' >temp.text | |
pidToStop=$( (sed '2q;d' temp.text)) | |
>temp.text | |
if [[ -n $pidToStop ]]; then | |
kill -9 $pidToStop | |
echo "Killed process $pidToStop running on port $1." | |
else |
This file contains hidden or 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
# rename all JS files in src/ to TS | |
find src -name '*.js' -exec bash -c 'git mv "$0" "${0%.js}.ts"' "{}" \; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Adjacent hover highlight</title> | |
<style> | |
body { | |
font-family: sans-serif; | |
} |
This file contains hidden or 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
/** | |
* Escape RegExp special characters | |
* | |
* Inlined from [email protected] as we don't use ESM here. | |
* | |
* @see https://github.com/sindresorhus/escape-string-regexp | |
* | |
* @param {string} string | |
* @returns {RegEx} | |
*/ |
NewerOlder