In this Full stack tutorial i build a complete authenticated todo list app. I bootstrap the application with the T3 stack boilerplate. Then I set up email magic link authentication with next-auth. I create all the TRPC backend routes to create, read, update and delete todos. I implement the corresponding functionality on the frontend side using the TRPC query and mutation hooks and add some tailwind styling. Lastly I ensure a really snappy user experience by adding optimistic updates to the frontend. Happy watching!
In this tutorial i explain the javascript array method reduce. I show how to sum and multiply numbers, and then i show how to bake banana bread using reduce. Reduce looks over the array items but also keeps an accumulated value passed into every iteration of the loop. What is returned from the callback becomes the accumulated value in the next iteration. The value returned from the last loop interation becomes the returned value from the reduce call. Reduce does not modify the array it is called on.
Link to the code: https://gist.github.com/danba340/b353da579019ed3698f71a675d809080
Say hi on twitter: https://twitter.com/barelydaniel
0:00 Intro
0:25 How reduce works
1:40 How to sum a list of numbers
3:05 How to multiply a list of numbers
4:15 Baking banana bread with reduce
10:53 Best regards
...
https://www.youtube.com/watch?v=vEcpy3tBBxQ
In this tutorial we look at how to build a "Sign in with Github" OAuth solution. We will use node to build the backend with 3 routes and a frontend to go with it with HTML, CSS and Javascript. We will also look at how to create a new OAuth application in Github.com.
The routes we need are "/", "/auth" and "/oauth-callback". We will send the user to github once they click the sign in button. We will pass the clientId of our oauth app so that Github knows from where the user came. If the user signs in to Github or just press "Accept if they were already logged in they will be redirected to our site on the route which we specified. In this case it is "oauth-callback". Github will give us a code that we can use to retrieve an authorization token from Github and then we can use that token to access some data from their Github profile.
Hope you enjoy the tutorial!
Code: https://github.com/danba340/oauth-github-example
Say hi on twitter: https://twitter.com/barelydaniel
...
https://www.youtube.com/watch?v=PdFdd4N6LtI
In this video i dip my toes in the world of functional programming in Javascript by exploring composition.
I try to wrap my head around a compose() function that takes an array of functions and runs them after one another and passes on the accumulated value.
0:00 Intro
1:10 Small composable functions
2:50 The compose function
5:20 Composing the functions
8:15 Some words on composition
9:30 Outro
...
https://www.youtube.com/watch?v=xKFO9NCogLg
7 years ago i decided to switch careers and go into programming.
However i did have 2 big worries:
1. Will I lose interest in programming and when?
2. Am i even capable of learning this very tricky way of thinking?
Since then it's been 7 years of work and over a hundred hobby project. For me the answer is very clear.
It ended up being the best work related decision i ever made.
Now i will show you my latest hobby project and i hope it will leave you inspired to keep learning programming or even pick it up for the first time.
My latest hobby project is built to simplify my daily life in terms of using the public transport system of Gothenburg. I have built my own Progressive web app talking to the public transport API where i have aggregated together multiple requests into a single list of transport options saving me lots of time and frustration daily. The tech stack is Next.js together with react-query. React query helps with requests depending on other queries like a query to get an api auth token and to aggregate many queries into one resulting array by using the useQueries hook.
Tiktok: https://www.tiktok.com/@barelycoding
Twitter: https://twitter.com/BarelyDaniel
Github: https://github.com/danba340
0:00 Why programming is worth it
0:37 Problem description
1:48 Commuting frustrations
3:22 Figuring out API Access
5:46 Config file for App
6:50 Route info Next.js API endpoint
8:37 Consuming route info with react-query
10:07 Styling from response payload
11:30 Progressive web app
11:55 Running the app
12:50 Can i regain my development time?
14:05 Thanks for watching!
...
https://www.youtube.com/watch?v=1bMP4armEtc
This video starts with me talking about the diference between React and ReactDOM. React Three Fiber uses React to keep track of 3D objects that gets rendered in a webGL canvas via three.js . The result is the ability to code 3D environments the same way you are used to code a React Web Application. We can even add physics and animation to the 3D objects in the world. In this example we place a Box on a Plane inside a Skybox of stars. We then add physics to let the box fall on the plane and finally we interact with the box by attaching a click event to the box. For the physics we are using React hooks for Cannon.js.
Code for this video: https://github.com/danba340/react-three-fiber-example
Say hi on twitter: https://twitter.com/barelydaniel
0:00 React vs ReactDOM
1:13 React Three Fiber
2:18 Boilerplate
3:20 Creating a Box
4:20 Controlling the camera
5:35 Lights
6:23 SkyBox of Stars
7:00 Creating a Ground Plane
9:00 Physics with Cannon.js
11:30 Interacting via Click Event
13:00 Outro
...
https://www.youtube.com/watch?v=FGG0EeMNUl0
Trying out code environment Deno (similar to Node js).
Installation.
Deno run.
Creating a Hello World module in my Github.
Importing modules.
Web server (serve).
Await and fetch.
...
https://www.youtube.com/watch?v=F4lsbTG5m2A