-
Give quick overview of current Navigation usage
-
Pose question "Why are we defining our own API?"
- Why not just use React's component API?
-
Go over Navigation implementation
-
Point out that the reason we're using our own object API
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 { z } from "zod"; | |
import { zodToTs, printNode } from "zod-to-ts"; | |
// Replace with your `openai` thing | |
import { openai } from "../openai.server"; | |
import endent from "endent"; | |
function createJSONCompletion<T extends z.ZodType>({ | |
prompt, | |
schema_name, |
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
use crate::type_context::{Element, TypeContext}; | |
use ::common::unique_name::UniqueName; | |
use ::hir::{ | |
hir, BinOp, Binding, Expr, ExprKind, Lit, LitKind, Local, StatementKind, | |
Type as HIRType, UnOp, | |
}; | |
use ::hir::visit::{walk_component, walk_function, Visitor}; | |
use data_structures::HashMap; | |
use diagnostics::ParseResult as Result; |
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
#!/bin/bash | |
set -e | |
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
if [ "$BRANCH" = 'master' ] | |
then | |
echo You must check out a feature branch first | |
exit 1 | |
fi |
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
// Option is a simple example of an enum | |
// that is generic, with a variant that doesn't | |
// use that generic type. (None) | |
enum Option<T> { | |
Some(T), | |
None, | |
} | |
// Two functions that take different types of `Option`s | |
fn with_option_string(input: Option<string>) {} |
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 signPage() { | |
document.querySelectorAll("a[id^=sig]").forEach((node) => { | |
node.click(); | |
}); | |
setTimeout(() => { | |
document.querySelector('[data-bb-handler="sign"]').click(); | |
setTimeout(() => { | |
document.querySelector(".goto_next_page").click(); | |
}, 100); | |
}, 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
fn for_expr(&mut self) -> Result<ast::Expr> { | |
self.expect(TokenKind::Reserved(Keyword::For))?; | |
let lo = self.span; | |
let pattern = self.local_pattern()?; | |
self.expect(TokenKind::Reserved(Keyword::In))?; | |
let expr = self.expr(Precedence::NONE)?; | |
let block = self.block()?; | |
let span = lo.merge(self.span); | |
Ok(ast::Expr { | |
id: DUMMY_NODE_ID, |
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
console.groupWithTrace = (name, fn) => { | |
console.group(name); | |
fn(); | |
console.groupCollapsed(); | |
console.trace(name); | |
console.groupEnd(); | |
console.groupEnd(); | |
}; | |
function add(x, y) { |
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 useMutableReducer from "./useMutableReducer"; | |
const reducer = (draft, action, state) => { | |
switch (action) { | |
case "increment": | |
draft.count++; | |
break; | |
case "decrement": | |
draft.count--; |
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 { createSubscription } from 'create-subscription' | |
// Create the subscription, which will manage adding and removing the | |
// event listener for us when the component mounts and unmounts, respectively. | |
const AddEventListenerSubscription = createSubscription({ | |
getCurrentValue() { | |
// Since there's no "current value" for an event listener, we just |
NewerOlder