Package | Badges | Details |
---|---|---|
typedoc-plugin-markdown | [Readm |
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
/* https://news.ycombinator.com/item?id=29346918 */ | |
<div id=result></div> | |
<script> | |
document.getElementById("result").textContent = "Why do it this way—"; | |
document.querySelector("result").textContent = "—or even this way—"; | |
result.textContent = "—when you can do it this way?"; | |
</script> |
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
setInterval(function() { | |
var heading = Array.from(document.querySelectorAll('h2[role="heading"]')).find((header) => { | |
return header.innerText === "What’s happening" | |
}) | |
var whatsHappening = heading && heading.parentNode && heading.parentNode.parentNode && heading.parentNode.parentNode.parentNode | |
// Kill Whats happening garbage | |
if (whatsHappening) { | |
whatsHappening.style.display = 'none' |
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
// https://github.com/softvar/js/blob/master/packages/util-array/src/index.ts#L97 | |
function sortOnKey(arr, key, direction = 'asc' ) { | |
if (!arr || !arr.length || !key) { | |
return []; | |
} | |
const dir = direction === 'asc' ? 1 : -1 | |
arr.sort((a, b) => { | |
return b[key] > a[key] ? -1 : a[key] > b[key] ? dir : 0; | |
}); |
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
# via https://github.com/getsentry/sentry-docs/blob/ee13e55eac4a0fa946a6c16b43d302ff18552556/scripts/bump-version.sh | |
LATEST_SHA="$(curl -sSL 'https://api.github.com/repos/getsentry/sentry-api-schema/commits/main' | awk 'BEGIN { RS=",|:{\n"; FS="\""; } $2 == "sha" { print $4 }')"; | |
echo $LATEST_SHA; |
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
# https://stackoverflow.com/questions/2440947/how-to-build-a-conditional-assignment-in-bash | |
(condition) \ | |
&& variable=true \ | |
|| variable=false | |
e.g as in | |
[[ $variableToCheck == "$othervariable, string or number to match" ]] \ | |
&& variable="$valueIfTrue" \ | |
|| variable="$valueIfFalse" | |
or to get 1 in a positive check, and 0 upon failure (like in the question's example): |
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 Analytics from 'analytics' | |
import onRouteChange from '@analytics/router-utils' | |
const persistPageViewsPlugin = { | |
name: 'persist-page-data-plugin', | |
page: ({ payload }) => { | |
const { properties } = payload | |
const pageView = { | |
path: properties.path, | |
title: properties.title, |
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
// via https://yeun.github.io/open-color/ | |
const palette = { | |
dark: [ | |
'#d5d7e0', | |
'#acaebf', | |
'#8c8fa3', | |
'#666980', | |
'#4d4f66', | |
'#34354a', |
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
{ | |
"if-not-ci": "pnpm ts support/scripts/run-if-not-ci.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
function highlightMatch(string, regexp) { | |
return escapeString(string).replace(regexp, (match) => `<mark>${match}</mark>`) | |
} | |
// Used to match HTML entities and HTML characters. | |
const unescapedHtml = /[&<>"']/g | |
const hasUnescapedHtml = RegExp(unescapedHtml.source) | |
const htmlEscapes = { | |
'&': '&', |