Let's examine the type for Entity.
export interface Model {};
export type Entity<
TModels extends Model[],
> = {
id?: string,
creatorId?: string,
createTimeMs?: number,| gitf () | |
| { | |
| prefix="dev/$USER/" | |
| branch=$(git rev-parse --abbrev-ref HEAD) | |
| if [[ "$branch" = $prefix* ]]; then | |
| echo "[INFO]: Force pushing to branch '$branch'..." | |
| git push origin ":$branch" ; git push origin -u "$branch" | |
| else | |
| echo "[INFO]: Cannot push to branch '$branch' because it does not match prefix '$prefix'." | |
| } |
Let's examine the type for Entity.
export interface Model {};
export type Entity<
TModels extends Model[],
> = {
id?: string,
creatorId?: string,
createTimeMs?: number,| import { NonObject } from "./core-types"; | |
| export type DeepComplete<T> = T extends NonObject | |
| ? Exclude<T, undefined> | |
| : T extends Array<infer U> | |
| ? DeepCompleteArray<U> | |
| : T extends Map<infer K, infer V> | |
| ? DeepCompleteMap<K, V> | |
| : DeepCompleteObject<T>; |
| // Within SPA webapp | |
| import { useEffect } from 'react'; | |
| export default function() { | |
| useEffect(() => { | |
| window.addEventListener('keydown', (event) => { | |
| if ((event.ctrlKey || event.metaKey) && event.code === "KeyC") { | |
| document.execCommand("copy"); | |
| } else if ((event.ctrlKey || event.metaKey) && event.code === "KeyX") { | |
| document.execCommand("cut"); |
| import { useState, useEffect, useCallback } from 'react'; | |
| const getSize = () => { | |
| return { | |
| width: window.innerWidth, | |
| height: window.innerHeight, | |
| }; | |
| }; | |
| export function useResize() { |
| function hashString(s) { | |
| let hashValue = 0; | |
| for (let i = 0; i < s.length; i++) { | |
| hashValue = (hashValue * 31 + s.charCodeAt(i)) % 4294967296; | |
| } | |
| let bucket = Math.floor((hashValue / 4294967296) * 8); | |
| return bucket; | |
| } | |
| @prmichaelsen/[email protected] /Users/patrick/workplace/parm-v1.0.0 | |
| ├─┬ @angular/[email protected] | |
| │ ├─┬ @angular/[email protected] | |
| │ │ ├── @angular/[email protected] deduped | |
| │ │ ├── [email protected] deduped | |
| │ │ └── [email protected] deduped | |
| │ ├─┬ @angular/[email protected] | |
| │ │ ├── [email protected] deduped | |
| │ │ ├── [email protected] deduped | |
| │ │ └─┬ [email protected] |
| import React, { | |
| useEffect, useRef, | |
| useState, useCallback, | |
| } from 'react'; | |
| export function useResize() { | |
| const getSize = () => { | |
| return { | |
| width: window.innerWidth, | |
| height: window.innerHeight |
| #!/usr/bin/env ts-node | |
| const grades: [number, string][] = [ | |
| [96, 'A+'], | |
| [93, 'A' ], | |
| [90, 'A-'], | |
| [86, 'B+'], | |
| [83, 'B '], | |
| [80, 'B-'], | |
| [76, 'C+'], |