- learn how to bundle backend using webpack in a single bundle (check this https://gist.github.com/jgcmarins/2860f547f5d785dce24ca0eadbe3abdd)
- learn how to automate lamdba deploys using serveless or aws cdk (github actions)
- learn how to configure and automate api gateway
- learn how to automate tests lambdas using jest
- learn how to configure, automate and use RDS Proxy to fast database workflow in lamdbas (also cache database connections)
- how the performance gain using RDS Proxy over normal database usage
- learn about cold start and lambda statefull (https://www.swyx.io/stateful-serverless/)
- expose a CRUD api in lamdba
- put everything on open source (github)
- write a blog post about each of the topics above
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 axios from 'axios' | |
| import { useOptimisticMutation } from "./useOptimisticMutation.ts" | |
| type Response = boolean | |
| type Error = unknown | |
| type MutationVariables = {itemId: string} | |
| type Items = {id: string; name: string}[] | |
| type Likes = {itemId: string}[] | |
| type History = {type: string}[] |
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 { useCallback } from "react"; | |
| import { useQueryClient } from "@tanstack/react-query"; | |
| export default function useOptimisticUpdate() { | |
| const queryClient = useQueryClient(); | |
| return useCallback( | |
| async (queryKey, updater) => { | |
| await queryClient.cancelQueries({ queryKey }); |
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 {Dimensions, FlatList, View} from 'react-native'; | |
| const screenWidth = Dimensions.get('window').width; | |
| const numColumns = 2; | |
| const gap = 5; | |
| const availableSpace = screenWidth - (numColumns - 1) * gap; | |
| const itemSize = availableSpace / numColumns; | |
| const renderItem = ({item}) => { |
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 { useCallback, useState } from 'react'; | |
| import { | |
| QueryFunction, | |
| QueryKey, | |
| useQuery, | |
| UseQueryOptions, | |
| UseQueryResult, | |
| } from 'react-query'; | |
| type UseQueryParams = Parameters<typeof useQuery>; |
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 { Suspense, useState, useEffect } from 'react'; | |
| const SuspensefulUserProfile = ({ userId }) => { | |
| const [data, setData] = useState({}); | |
| useEffect(() => { | |
| fetchUserProfile(userId).then((profile) => setData(profile)); | |
| }, [userId, setData]) | |
| return ( | |
| <Suspense> | |
| <UserProfile data={data} /> |
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 { RouterContext } from 'next/dist/next-server/lib/router-context' | |
| import Router from 'next/router' | |
| import React from 'react' | |
| Router.router = { | |
| route: '/', | |
| pathname: '/', | |
| query: {}, | |
| asPath: '/', | |
| push(url, as, options) { |
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
| # Luke's config for the Zoomer Shell | |
| # Enable colors and change prompt: | |
| autoload -U colors && colors | |
| PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " | |
| # History in cache directory: | |
| HISTSIZE=10000 | |
| SAVEHIST=10000 | |
| HISTFILE=~/.cache/zsh/history |