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
# Go to the download folder where the JSON file is, right click in the | |
# File Explorer, click open Terminal. Then run the below command: | |
# | |
# export_entries.ps1 data.json > entries.txt | |
# | |
# Note: make sure that the JSON file is valid, e.g. get rid of the object at | |
# the top of the file with the export date and etc. If your app changes their | |
# output structure the script will need to be updated. | |
param ( | |
[string]$journalPath |
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 { IObjectWithKey, Selection, SelectionMode } from '@fluentui/react'; | |
import { useEffect, useRef } from 'react'; | |
/** Options interface for the `useControlledFluentSelection` hook. */ | |
export interface ControlledSelectionOptions<T> { | |
/** The currently selected items. */ | |
selectedItems: T[]; | |
/** Optional selection mode. */ | |
selectionMode?: SelectionMode; | |
/** Event handler called when the selected items change. */ |
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 { useState, Children, ReactElement, ReactNode } from "react"; | |
export function App() { | |
return ( | |
<Tabs> | |
<Tab name="Division">Division content!</Tab> | |
<Tab name="Wild card">Wild card content!</Tab> | |
<Tab name="Conference">Conference content!</Tab> | |
<Tab name="League">League content!</Tab> | |
</Tabs> |
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
// AudioControlsProvider.tsx | |
import { createContext, useState, ReactNode, useContext } from 'react'; | |
// This is the interface of our context object, i.e. this is the interface of | |
// stuff that normal components will have access to | |
export interface AudioControls { | |
isAudioPlaying: boolean; | |
pauseAudio: () => void; | |
} |
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
// useInitializeTrackPlayer.ts | |
function useInitializeTrackPlayer() { | |
const [isInitialized, setIsInitialized] = useState(false); | |
useEffect(() => { | |
async function initializeTrackPlayer() { | |
await TrackPlayer.setupPlayer(); | |
TrackPlayer.setOptions(...); // maybe await this? Not sure if it's async | |
setIsInitialized(true); |
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
type ErrorFirstCallback<D> = (error: any, data: D) => void; | |
type FunctionThatAcceptsCallback<A extends any[], D> = ( | |
...args: [...A, ErrorFirstCallback<D>] | |
) => void; | |
type FunctionThatReturnsPromise<A extends any[], D> = (...args: A) => Promise<D> | |
function promisify<A extends any[], D>( | |
originalFunction: FunctionThatAcceptsCallback<A, D> |
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 { Dispatch, SetStateAction, useEffect, useState } from "react"; | |
interface VisibilityTrackerResult { | |
/** Ref callback, give this to the element to be observed */ | |
ref: Dispatch<SetStateAction<HTMLElement | null>>; | |
/** Whether or not the observed element is currently visible */ | |
isVisible: boolean; | |
} |
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
export interface TemperatureUnitToggleProps { | |
selectedUnit: TemperatureUnit; | |
onChange: (temperatureUnit: TemperatureUnit) => void; | |
} | |
/** | |
* A toggle component to swap between Celsius and Fahrenheit | |
*/ | |
export const TemperatureUnitToggle: FunctionComponent<TemperatureUnitToggleProps> = ({ selectedUnit, onChange }) => { | |
const isCelsiusSelected = selectedUnit === TemperatureUnit.Celsius; |
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
alias gpob='git push -u origin $(getCurrentGitBranch)' | |
getCurrentGitBranch() { | |
local branch=$(git rev-parse --abbrev-ref HEAD) | |
echo $branch; | |
} |
NewerOlder