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 SwiftUI | |
import PDFKit | |
import PDFBlocks | |
struct CVPreviewView: UIViewRepresentable { | |
var pdfDocument: PDFDocument | |
init(pdfData pdfDoc: PDFDocument) { | |
self.pdfDocument = pdfDoc | |
} |
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
async function getRecordDetails(recId: String): Promise<Models.Doc> { | |
const client = new Client() | |
.setEndpoint(APPWRITE_URL) | |
.setProject(APPWRITE_PROJECT) | |
.setKey(APPWRITE_API_KEY) | |
const databases = new Databases(client) | |
return databases.getDocument(DATABASE_ID, COL_ID, recId) | |
} | |
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
const graphqlString = ` | |
mutation Something($somethingData: SomethingInput!) { | |
something(somethingData: $somethingData) { | |
name | |
} | |
} | |
` | |
test('something that requires user auth', async () => { | |
const { jwt } = await getNewUser() |
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
describe('a feature of the app', () => { | |
let server, url | |
beforeAll(async () => { | |
// assigns the values returned to the variables in the upper scope | |
({ server, url } = await createApolloServer({ port: 0 })) | |
}) | |
afterAll(async () => { | |
await server?.stop() |
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
async function getNewUser(): Promise<{ user: Models.User<Models.Preferences>, jwt: string}> { | |
const client = new Client() | |
.setEndpoint(APPWRITE_URL) | |
.setProject(APPWRITE_PROJECT) | |
.setKey(APPWRITE_API_KEY) | |
const users = new Users(client) | |
const userEmail = `test-user-${randomUUID()}@test.com` | |
const user = await users.create(ID.unique(), userEmail, undefined, NEW_USER_PASSWORD, userEmail) | |
const agent = request.agent(APPWRITE_URL) | |
await agent |
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 {Account, Client, Databases, Models} from "node-appwrite"; | |
import {ListenOptions} from "node:net"; | |
import {ApolloServer} from "@apollo/server"; | |
import {startStandaloneServer} from "@apollo/server/standalone"; | |
async exampleFunction(databases: Databases, user: Models.User<Models.Preferences>) { | |
const doc = await databases.createDocument('databaseId', 'colId', user.$id) // do something with a database | |
} | |
const resolvers = { |
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
.bag { | |
/* hoist the item list scroll progress scope to the parent so can be shared */ | |
timeline-scope: --item-list-scroll-timeline; | |
} | |
.item-list { | |
/* make the item lists y-axis scroll progress available as a variable */ | |
scroll-timeline: --item-list-scroll-timeline y; | |
} |
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
.bag { | |
/* hoist the item list scroll progress scope to the parent so can be shared */ | |
timeline-scope: --item-list-scroll-timeline; | |
} | |
.item-list { | |
/* make the item lists y-axis scroll progress available as a variable */ | |
scroll-timeline: --item-list-scroll-timeline y; | |
} |
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
.item-list { | |
/* make the item lists y-axis scroll progress available as a variable */ | |
scroll-timeline: --item-list-scroll-timeline y; | |
} | |
.bag-section-image { | |
/* The animation(s) to drive using the scroll progress */ | |
animation: item-bag-image linear; | |
/* Hook up the item lists scroll progress to drive the animation */ | |
animation-timeline: --item-list-scroll-timeline; |