Tim's Blog

Creating React components

Class components import React from 'react' export default class HelloWorld extends React.Component { render() { return <h1>Hello world!</h1>; } } Functional components import React from 'react' export default function HelloWorld(){ return <h1>Hello world!</h1> }

How to setup Redux in a React project

Installing Redux: npm install @reduxjs/toolkit react-redux Create a src/store folder. We will create a numeric counter in our state, Redux calls this a “slice” of the state. To create our slice, create src/store/counter.jsx . Each slice should live in a file similar to this one. // src/

How to setup routing in React with React Router

First step is to create a new React project. Check out how to do it here: How to create React app with ViteIn your terminal: npm create vite@latest You will be prompted by the setup, choose a project name eg. myApp, and choose React from the list of frameworks.

How to create React app with Vite

In your terminal: npm create vite@latest You will be prompted by the setup, choose a project name eg. myApp, and choose React from the list of frameworks. Then jump in and start developing: cd myApp npm install # start development server npm run dev

How to wget download multiple links in the background

First, create a text file (eg links.txt) containing all links you want to download. For example https://dumps.wikimedia.org/enwiki/20210820/enwiki-20210820-geo_tags.sql.gz https://dumps.wikimedia.org/enwiki/20210820/enwiki-20210820-page_props.sql.gz https://dumps.wikimedia.org/enwiki/20210820/enwiki-20210820-page.sql.gz https://dumps.wikimedia.org/

Tim's Blog © 2026