| Description | Command |
|---|---|
| Start a new session with session name | screen -S <session_name> |
| Run and detach a command instantly | screen -dmS <session_name> <your> <command> <here> |
| List running sessions / screens | screen -ls |
| Attach to a running session | screen -x |
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 { ShmReact } from '@/src/lib/utils/react'; | |
| import { Card } from '@/src/packages/shmood-db/api/types/immutable-card'; | |
| import { useCache } from '@/src/contexts/root-cache/react'; | |
| import { EditorState } from '@/src/contexts/board-state/editor-state'; | |
| import { AssetCardHeader } from '@/src/components/shm/asset-card-header'; | |
| import { Shmavatar } from '@/src/components/shm/avatar'; | |
| import { AssetMoreMenu } from '@/src/components/shm/asset-more-menu'; | |
| import { AssetPopoverMenu } from '@/src/components/shm/asset-popover-menu'; | |
| import React, { useEffect } from 'react'; | |
| import { EditorAssetZoneCardMenuController } from '@/src/components/logical/editor/editor-asset-zone-card-menu'; |
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 { useEffect, useRef, useState } from "react"; | |
| /** | |
| * Custom hook that maintains the previous value of a changing React state variable. | |
| */ | |
| export function usePrevious<T>(value: T): T | undefined { | |
| // The ref object is a generic container whose current property is mutable, and can hold any value, similar to an instance property on a class | |
| const ref = useRef<T>(); | |
| // Store current value in ref | |
| useEffect(() => { |
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://codesandbox.io/s/ramp-fe-challenge-wiczb6 |
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 React, { useEffect } from "react"; | |
| /** | |
| * Utility function to assert the target is a node | |
| * Lifted straight from https://stackoverflow.com/questions/71193818/react-onclick-argument-of-type-eventtarget-is-not-assignable-to-parameter-of-t | |
| */ | |
| function assertIsNode(e: EventTarget | null): asserts e is Node { | |
| if (!e || !("nodeType" in e)) { | |
| throw new Error(`Node expected`); | |
| } |
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 { useEffect, useRef } from "react"; | |
| /** | |
| * Custom hook that maintains the previous value of a changing React state variable. | |
| */ | |
| export function usePrevious<T>(value: T): T { | |
| // The ref object is a generic container whose current property is mutable, and can hold any value, similar to an instance property on a class | |
| const ref: any = useRef<T>(); | |
| // Store current value in ref | |
| useEffect(() => { |
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 } from "react"; | |
| type FlatStateType<T> = T; | |
| type FlatStateSetter<T> = <X>(props: SetterProps<T, X>) => void; | |
| type FlatStateGetter<T> = <X>(props: GetterProps<T, X>) => T | GetterRes<T>; | |
| type FlatUpdates = number; | |
| type FlatStateHookObj<T> = [MutationBundle<T>, FlatUpdates]; |
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 { useEffect, useRef } from "react"; | |
| /** | |
| * Custom hook that maintains the previous value of a changing React state variable. | |
| */ | |
| export function usePrevious<T>(value: T): T { | |
| // The ref object is a generic container whose current property is mutable, and can hold any value, similar to an instance property on a class | |
| const ref: any = useRef<T>(); | |
| // Store current value in ref | |
| useEffect(() => { |
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
| * { | |
| box-sizing: border-box; | |
| } | |
| html, | |
| body { | |
| height: 100%; | |
| } | |
| body { | |
| background-color: #1a1a1a; | |
| font-family: sans-serif; |
This file has been truncated, but you can view the full file.
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
NewerOlder