TILs From the Epic React Advanced Hooks Workshop

Here are some notes from the Epic React workshop Advanced Hooks. Function Dependencies in useEffect We use the useEffect hook to run side effects in React. The hook has a “dependency array” which tells it when to fire. That works fine if the trigger is a variable. Like this: const [count, setCount] = useState(0) React.useEffect(() => { // Update the document title using the browser API document.title = You clicked ${count}times }, [count]) // <– that's the dependency list What happens if we use a function as a trigger?
Read more →

TIL: How to Replace Backslashes (grep, sed, ripgrep, sd, ruplacer)

Today I needed to remove backslashes from a number of files. I have yaml frontmatter that should look like this: tags: - React.js - JavaScript I had some files that had backslashes before the dash: tags: - React.js - JavaScript You can use Unix tools like grep or sed to search all files that match a pattern. Then you can replace that pattern. But you have to remember that a backslash is a special character.
Read more →

Friday Picks 079

Read more →

How to Extend Express Request With Session in Typescript (TS2339 error)

You’ve got a Node.js back-end server running Express and want to store sessions. You use TypeScript for your server. Let’s see some example code. Excerpt: // src/resolvers/AuthResolver.ts import { MyContext } from '../graphql-types/MyContext'; // more imports // { … } @Mutation(() => UserResponse) async login( @Arg("input") { email, password }: AuthInput, @Ctx() ctx: MyContext ): Promise<UserResponse> { const user = await User.findOne({ where: { email } }) if (!
Read more →

Friday Picks 078

Here are five resources for this weekend: The Big List of 101 Places to Learn to Code for Free: tons of free resources Build and Deploy a Full Stack MERN Project - React + Redux, Node, Express, MongoDB [Part 1/2]: complete app tutorial in 2 parts Some “cool” machine learning books: a list of machine-learning books, might be of interest Next.js 101 - Free Online Course: short mini-course on Next.
Read more →

Black Friday Deals 2020

Here are the tech-related Black Friday Deals for 2020. HTML/CSS https://debuggingcss.com/ JavaScript/Node/React/Vue https://flaviocopes.com/blackfriday/ https://jamstackhandbook.com/ https://learnetto.com/blackfriday#Pricing https://nodecli.com https://react2025.com/ https://wesbos.com/courses https://www.leveluptutorials.com/ https://www.udemy.com/course/nestjs-zero-to-hero/?couponCode=DD074A391845400CC7E7 https://www.vuemastery.com/black-friday-2020/ Go https://buildsaasappingo.com https://lets-go.alexedwards.net https://www.calhoun.io/ Flutter https://codewithandrea.com/courses/ Domains/Hosting https://www.namecheap.com/ Python https://training.talkpython.fm/black-friday-2020 Elixir https://pragmaticstudio.com/ https://alchemist.camp/subscribe/level-up Ruby https://pragmaticstudio.com/ Misc Mastering Vim Quickly Standard Edition | Professional Training Package | Premium Training Package https://appbrewery.com/ https://deals.bytesized.xyz/ https://keleshev.com/compiling-to-assembly-from-scratch/ https://media.
Read more →

Friday Picks 077

Read more →

TIL About Vim’s Changelist

Read more →

Friday Picks 076

Read more →

Friday Picks 075

Read more →

Sign up for the newletter!

powered by Buttondown