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 type { ReactElement, ComponentType } from "react"; | |
import { useLocation, useNavigate, useParams } from "react-router-dom"; | |
export type Router = { | |
location: ReturnType<typeof useLocation>; | |
navigate: ReturnType<typeof useNavigate>; | |
params: ReturnType<typeof useParams>; | |
}; |
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
/** | |
* A higher-order function that wraps a given function with a call to | |
* `preventDefault` on the event. | |
*/ | |
export function withPreventDefault<T extends (...args: any[]) => any>( | |
originalFunction: T | |
) { | |
return function (...args: Parameters<T>): ReturnType<T> { | |
const event = args[0]; |
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
/** | |
* Creates a debounced function that delays invoking `func` only for subsequent | |
* calls within the `debounceDelayMs` period after the first call. | |
* | |
* - `func`: Function to debounce. Can be asynchronous. | |
* - `debounceDelayMs`: Milliseconds to delay subsequent calls. | |
* - Returns: A function returning a promise with `func`'s result. | |
* | |
* The first call to the debounced function is executed immediately, while | |
* subsequent calls within the `debounceDelayMs` period are debounced. |
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
""" | |
This script fetches and processes GitHub repository statistics. | |
- Fetches contributor statistics and pull requests from a specified GitHub repo | |
- Aggregates data by quarter and author | |
- Saves the aggregated data to a CSV file | |
- Saves raw data to a JSON file for troubleshooting | |
Functions: | |
- get_repo_stats: Fetches contributor statistics from GitHub |