import '@testing-library/jest-dom' | |
import { render } from '@testing-library/react' | |
import { renderHook } from '@testing-library/react-hooks' | |
import nock from 'nock' | |
import TestComponent from './TestComponent' | |
const mockResultData = [ | |
{ |
There are various ways to deal with spacing within a Mui Grid. spacing
has always been the "go-to" method, but there
are always a few different options when it comes to making your grid less compact. All of these can work but have a few
weird caveats that a developer should understand.
<Stack padding={1} spacing={3} direction="row" flexWrap="wrap">
<Typography>Hello</Typography>
<Typography>World</Typography>
Counting Lines of Code with GitHub Linguist and Bash
If you’re using GitHub Linguist to analyze your project’s code, you may want to take a closer look and see how many lines each individual file contains. GitHub Linguist provides a useful breakdown of the languages and files, but not an easy way to get line counts for each file. Let’s dive into how you can achieve this using a combination of GitHub Linguist, jq
, and some classic Bash commands.
Analyzing lines of code (LOC) per file is a useful metric to:
- Assess Complexity: Identifying files with excessive lines of code might highlight areas that could benefit from refactoring.
- Identify Hotspots: Knowing where most of the code resides helps focus efforts for documentation or optimization.
- Track Growth: Monitoring LOC helps gauge how your project is evolving over time.
In JavaScript, the interaction between return
, await
, and finally
can cause subtle issues that developers should be aware of. Here are some key gotchas:
- The
finally
block runs regardless of whether areturn
,throw
, or an exception occurs intry
orcatch
. - If
finally
has areturn
, it overrides any return value or thrown error fromtry
orcatch
.
function test() {
try {
return "from try";
import { Observable } from '@opentelemetry/api'; | |
import debug from 'debug'; | |
import { deepEqual } from 'fast-equals'; | |
import { DateTime, Duration } from 'luxon'; | |
const debugLog = debug('graphile-worker:metrics'); | |
/** | |
* A wrapper around an OpenTelemetry gauge, allowing synchronous reporting of values (which are still collected asynchronously). | |
* |