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
/** | |
* Uploads artifacts with a set concurrency limit. | |
*/ | |
async function uploadWithConcurrency( | |
artifacts: BunnyArtifact[], | |
concurrency: number, | |
task: (artifact: BunnyArtifact) => Promise<void> | |
): Promise<void> { | |
const queue: Promise<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
{ | |
"index_name": "trakas", | |
"start_urls": [ | |
"https://trakas.js.org" | |
], | |
"stop_urls": [], | |
"selectors": { | |
"lvl0": { | |
"selector": "(//ul[contains(@class,'menu__list')]//a[contains(@class, 'menu__link menu__link--sublist menu__link--active')]/text() | //nav[contains(@class, 'navbar')]//a[contains(@class, 'navbar__link--active')]/text())[last()]", | |
"type": "xpath", |
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
class DagreWidget extends React.Component<DagreWidgetProps, any> { | |
engine: DagreEngine; | |
constructor(props: any) { | |
super(props); | |
this.engine = new DagreEngine({ | |
graph: { | |
rankdir: "RL", | |
ranker: "longest-path", | |
marginx: 25, |
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 { | |
Avatar, | |
Box, | |
Button, | |
Checkbox, | |
Container, | |
CssBaseline, | |
FormControlLabel, | |
Grid, | |
Link, |
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 { Router } from "@reach/router"; | |
import { useMachine } from "@xstate/react"; | |
import { SnackbarProvider } from "notistack"; | |
import React from "react"; | |
import Header from "./components/Header"; | |
import SignIn from "./components/SignIn"; | |
import AuthMachine from "./states/AuthMachine"; | |
const App: React.FC = () => { | |
const [current, send] = useMachine(AuthMachine, { devTools: true }); |
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 { | |
assign, | |
DoneInvokeEvent, | |
EventObject, | |
Machine, | |
send, | |
sendParent, | |
StateMachine, | |
StateSchema | |
} from "xstate"; |
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 { | |
assign, | |
EventObject, | |
Machine, | |
send, | |
StateMachine, | |
StateSchema | |
} from "xstate"; | |
import { getToken } from "../apis"; | |
import LoginMachine from "./LoginMachine"; |
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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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 React from 'react'; | |
import { Redirect, Route } from 'react-router-dom'; | |
import { checkAuthentication } from '../../store/selectors/user'; | |
function withAuthRoute(checkAuth, pathname) { | |
return function AuthRoute({ component: Component, ...rest }) { | |
return ( | |
<Route | |
{...rest} | |
render={props => { |
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 React, { useEffect, useState } from "react"; | |
import DataSource from "../DataSource"; | |
const TextBlock = ({ text }) => <>{text}</>; | |
export function BlogPost({ id }) { | |
// State is declared in pair: state value and setState function | |
const [data, setData] = useState(DataSource.getBlogPost(id)); | |
// Similar to componentDidMount and componentDidUpdate: |
NewerOlder