--dry-run
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> | |
<title>Canvas - animated gradient Background</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" | |
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="row mt-5"> |
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 * as React from "react"; | |
function useRenderComponent<T>(Component: React.FC, initialProps?: T) { | |
const [props, setProps] = React.useState<T>(initialProps); | |
const updateProps = <K extends keyof T>( | |
field: K, | |
value: T[K] | |
) => | |
setProps((prevState: T) => ({ | |
...prevState, |
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
/** | |
* @desc range 0 - 9 | |
*/ | |
type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | |
export declare namespace ISO8601 { | |
/** | |
* @desc range 00 - 24 | |
*/ | |
type TimeHour = `${'0' | '1' | '2'}${'0' | '1' | '2' | '3' | '4'}` |
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
/* | |
https://www.typescriptlang.org/play?ssl=1&ssc=1&pln=16&pc=15#code/MYGwhgzhAECC0G8BQ1oAcCuAjEBLY0EALmEftAGa4CmIAJtALyIB2YAttQFzQDksvAL4p02PASIB7AMpEATrhYBzABQBKRCNRzqRDHJbQA8lgBW1YEQB0S3QAU5kqUQCeaakYoqiAC1wQ1K2BJFmI5DEtJOSsqWjoRYWEkUEgYACFoagAPImoWOhh4ZFRMHHJiUnJY+iZWDm4+NKEkJODQomgwWpZqAHc4dQBuZJDiaCxuvug0oaQR0MkQaisQSVUwNXmIReXV1Sw1IA | |
*/ | |
class A { | |
public static field = 'A' | |
public toString() { | |
return Object.getPrototypeOf(this).constructor.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
/* | |
* https://github.com/contentful/contentful.js/blob/master/index.d.ts#L81 | |
*/ | |
type Entry<Fields> = { | |
sys: { | |
id: string | |
} | |
fields : Fields | |
} |
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
/* | |
For very big spaces, we can create chunks of the export, and import them separately. | |
To make it work, we have to keep a specific order. | |
*/ | |
const fs = require('fs'); | |
const path = require('path'); | |
/* the order of types must be kept */ | |
const types = [ |
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 { CollectionProp } from 'contentful-management/types'; | |
type CollectionFuncResponse<TItem> = Promise<CollectionProp<TItem>>; | |
type CollectionFunc<TItem> = (skip: number, limit: number) => CollectionFuncResponse<TItem>; | |
export async function getAllCollectionItems<TItem>( | |
endpoint: CollectionFunc<TItem>, | |
skip = 0, | |
limit = 100 | |
): Promise<Array<TItem>> { |