Step-by-Step Guide to Manage OCaml Installations With asdf

Use asdf to manage opam (and OCaml) asdf is a command-line tool which allows you to install multiple versions of a programming language. With asdf you have absolute control over which language version gets installed on your system. You can also switch between different versions. That's useful if you work with several projects that might use different versions. I wrote about asdf a while ago. In this post, I will go over the steps on how to manage OCaml via asdf.
Read more →

Friday Picks 032

Read more →

TIL: Replace Local Files With Remote Files With Git

Read more →

Tmux Workflow

Now that we've installed tmux, the terminal multiplexer, how do we use it? Start your project from your shell In the terminal, I navigate to the directory containing my project. Start a new tmux session tmux new -t <project-name> I usually name the tmux session after the project directory to avoid confusion. For example, if the project folder is called flask-react-auth, I create a new session with: tmux new -t flask-react-auth.
Read more →

Make Vim Work With Tmux

I've been toying around with tmux today. tmux is a terminal multiplexer. It lets you switch easily between several programs in one terminal, detach them (they keep running in the background) and reattach them to a different terminal. My terminal of choice is kitty, a GPU-based terminal emulator with tons of options. kitty even offers windows and tabs, so I didn't need to use tmux for creating new terminal panes.
Read more →

babel-eslint and prettier-eslint-cli Are Broken

A while ago I figured out how to format and prettify all JavaScript files in a project. The guide worked for me at the time of writing. Unfortunately, the current versions of babel-eslint and prettier-eslint-cli are both broken. Relative paths are broken with prettier-eslint-cli and eslint 6.7.0 prettier-eslint [ERROR]: There was trouble creating the ESLint CLIEngine. There is a workaround for Linux and MacOS: inject $(pwd) before the file path.
Read more →

Post Data From the Command Line

If you want to interact with an API via the command line, curl is the obvious choice on a Linux machine. Most of the time, curl comes pre-installed on your system. The command utility is very fast, but not very user-friendly. curl Here's an example for a POST request with json: curl -d '{"username":"jane","email":"jane@test.cc"}' -H "Content-Type: application/json" -X POST https://desolate-cliffs-02122.herokuapp.com/users PUT: curl -d '{"username":"jane","email":"jane@test.cc"}' -H "Content-Type: application/json" -X PUT https://desolate-cliffs-02122.herokuapp.com/users/1 You can find a detailed explanation on GitHub Gists.
Read more →

Fix Wrong Email Address in Git

You've pushed your code to GitHub/GitLab, but didn't set the correct author's email - what now? When you take a look at the remote code repository (GitHub, GitLab, or similar), the commit is linked to the wrong user. Fix single git commit with the wrong email address/user name Fix the git configuration in your terminal (local): git config user.name "Your name" git config user.email "your@email.com" Rebase
Read more →

Tool: Backslide

I've completed the slides for my first tech talk today. I wanted a simple, developer-friendly tool, which I can use with Markdown. Enter backslide, a command-line tool that creates HTML presentation slides from Markdown files. You can style templates with SASS, so your slides will look nice, too. Installation & Usage You'll need Node.js: npm install -g backslide # or yarn add backslide That'll give you a command called bs. You can create a new project with bs init, serve files locally with bs serve and export your Markdown document to HTML with bs export.
Read more →

TIL: How to Use Both Gitlab and Github

There are several ways to mirror a repository both on GitLab and GitHub. Repository Mirroring The free GitLab plan allows you to pull from a remote repository. You could use a GitHub repository as the main repo, and the GitLab repo as the mirror. In theory, you can also push from GitLab to GitHub. But I couldn't get it working on GitLab's free plan. Remote Repositories and Overloading The alternative is to “overload” your remote repository address.
Read more →