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 java.util.Scanner; | |
public class Menu { | |
public static void main(String[] args) { | |
promptUser(); | |
} | |
static void promptUser() { | |
Scanner scanner = new Scanner(System.in); |
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
private static void ParseFindings(String input) { | |
Scanner scanner = new Scanner(input); | |
List<List<String>> discoveries = new ArrayList<>(); | |
int discoveryIndex = 0; | |
while (scanner.hasNextLine()) { | |
String line = scanner.nextLine(); | |
if (discoveryIndex >= discoveries.size()) { |
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 java.io.File; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Scanner; | |
public class PopulateDatabase { | |
// Main for del 1 | |
public static void main(String[] args) { |
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
function App() { | |
return ( | |
<div className={styles.container}> | |
{/* */} | |
{/* */} | |
<div className={styles.blockScroller}> | |
{/* */} | |
{/* */} | |
<div className={styles.inlineScroller}> | |
<div className={styles.drawer}> |
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 { useReducer, type Reducer, useEffect, useRef, useMemo } from 'react'; | |
import { useConst } from '../hooks'; | |
/** | |
* For when side effects are needed using React's built in useReducer. | |
* You can listen to dispatched events and fire callbacks when the state is updated. | |
* | |
* @note | |
* - Only criteria is that events/actions are typed as objects w a required `type` field. | |
* |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<style> | |
html, body { | |
height: 100%; | |
min-height: 100%; |
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
/* | |
* Here's an alternative approach that uses the ternary operator instead of `if/else`. | |
* It does just the same as the other example just expressed slightly differently. | |
* | |
* DOCS: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_operator | |
*/ | |
const secret = "coconut" | |
const guess = prompt() | |
const response = guess === secret ? "Ding ding!!" : "Nope…" |
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 { HasKeys, IsEmpty, RequiredFields } from "." | |
export type OptionalIfEmpty<T> = [ | |
...(IsEmpty<T> extends true | |
? [never?] | |
: HasKeys<RequiredFields<T>> extends true | |
? [T] | |
: [T?]) | |
] |
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 { useMemo, useReducer } from "react" | |
import produce, { castImmutable } from "immer" | |
import { isEqual } from "lodash-es" | |
import { NonEmpty } from "~utils/types" | |
interface SetValue<T> { | |
<K extends keyof T>( | |
next: NonEmpty<Pick<T, K>> | null, | |
restoreInitial?: boolean | |
): void |
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
// hmmmmm loop arbitrary iteration count | |
for (const [index] of Array(len).entries()) { | |
console.log(index) | |
} | |
for (const index of Array(len).keys()) { | |
console.log(index) | |
} |
NewerOlder