TIL About Vim’s Changelist

Read more →

4 TILS from the Epic React Basic React Hooks Workshop

What did I learn from the workshop Basic React Hooks by Kent C. Dodds? Previously, I wrote down my learnings from the React Fundamentals workshop. The second workshop introduces React hooks. Here are some insights that I found useful: Set Initial State Via Props Set an initial value by adding props to a component: <Greeting initialName="George"> Take that as an argument to the function and pass it down to useState:
Read more →

3 TILs from the Epic React Fundamentals Workshop

Kent C. Dodds released his Epic React training course with a big fanfare last week. I was on the fence of buying this, as the pro license is a premium training course that comes with a premium price tag. The course is expensive compared to other online courses. For example, a year-long-subscription to Frontend Masters costs roughly the same. But as a life-long learner, I’m dedicated to becoming a better programmer.
Read more →

TIL About Adding a New Line to “git commit -m”

For Git messages I use git commit -m to add a headline to a git commit. So far, I’ve never used the detailed summary which you can add to a commit message. It was tooMuch of a hassle to open a text editor and add a detailed explanation. Today I learned that you can write a multi-line commit message with git commit -m. For example, in Bash: git commit -m 'my headline Here goes the detailed explanation of the commit ' Source:
Read more →

TIL How to Assign Variables in Go

Declaration and Assignment Go is statically typed. Before you can bind a variable, you have to declare it: var age int This declares a new variable called age of type Integer. The variable is declared, but not initialized. If you want to assign something to a variable, you’ll do it like this: age = 35 There is a short-hand operator: :=: age := 35 The “walrus operator” is syntactic sugar for the two commands:
Read more →

TIL How to Execute an External Command in Vim and Reload the File

Or: How To Pipe The Current Vim Buffer Through Unix Commands In this post I will show you how to run a shell command from within Vim, and immediately reload that file. The Problem I write a Go file in (Neo)Vim. I want to use the command gofmt to format my file. Running gofmt will change the contents of my file, so I’ll need to reload my Vim buffer.
Read more →

TIL About Copying a Range in Vim

Today I learned about the copy command (alias t): :[range]co[py] {address} *:co* *:copy* Copy the lines given by [range] to below the line given by {address}.Let’s say we have a file like this: 1 line a 2 line b 3 line c 4 line d | You are on line d (symbolized with the | as the cursor). You want to copy from 1 to 3 (line a, line b, line c).
Read more →

TIL About Makefiles

Today I learned that you can use Makefiles to create simple task-runners. Stuart Feldman invented Make in 1976 to automate build processes for C programs. But you can use it for other languages, too. For example, Vladislav Supalov uses this Makefile for Docker commands: all: @echo "Usage: build or run" build: docker build -t test . run: docker run --rm -it test Now run the file with your terminal: make > Usage: build or run Build the Docker container via make build or run the container via make run.
Read more →

TIL About Array.prototype.fill (Javascript)

Today I learned about Array.prototype.fill and friends. You can use the method to fill an array with values, or create a new array filled with values. Pitfall: if you fill a new array with a value that is an object, each slot in the array will reference that object. const newArr = Array(4).fill([]) > [[], [], [], []] newArr[1].push(8) > 1 newArr > [[8], [8], [8], [8]] Further Reading MDN: Array.
Read more →

TIL About background-blend-mode

Read more →

Sign up for the newletter!

powered by Buttondown