VSCode seems to be one of the up and coming IDEs over the last year. I personally switched from Jetbrains IDEs to VSCode fo most of my development work at some point in 2020.
Apparently up until now I have avoided running the PHP debugger Xdebug. I had to do a little search around to figure out the correct settings for my setup decided to write them down in this handy blog post.
dockerit is a small CLI tool that I have been working on during the start of 2021. It’s intended to make running one off commands and CLI tooling easier in docker. Rather than having to write a long string of parameters for docker run, instead you can just use dockerit. This applies to both CLI usage, but also via bash aliases.
Github provided some advice for renaming branches focused around how this can be done in the UI. But with the Github CLI tool that was also release at the end of 2020 you can programatically make this change too.
The Github CLI tool is called gh. The README for the tool has installation instructions for a variety of platforms. One of the commands that it enables is called api, which can be used to “Make an authenticated GitHub API request”.
The Github API obviously allows you to perform most actions that can be performed by the UI, this we can use the gh cli tool to rename the branches of repositories.
For example, for the addwiki/addwiki repository, we can rename the master to main branch using the following command:
gh api --method POST repos/addwiki/addwiki/branches/master/rename --field new_name='main'
Code language:JavaScript(javascript)
And you can use such a command in whatever loops etc you want to, to quickly rename a whole bunch of branches in a whole bunch of repositories.
Toward the end of 2020 I spent some time blackbox testing data load times for WDQS and Blazegraph to try and find out which possible setting tweaks might make things faster.
I didn’t come to any major conclusions as part of this effort but will write up the approach and data nonetheless incase it is useful for others.
I expect the next step toward trying to make this go faster would be via some whitebox testing, consulting with some of the original developers or with people that have taken a deep dive into the code (which I started but didn’t complete).
One of the biggest sticking points for me, being fairly new with the Golang world, was trying to pass stdin stdout and stderr between the container and host terminal correctly, while also having good performance and doing the expected things (like Ctrl+C to cancel).
The full code for setting up and, interacting with and removing my container can be found here. The main steps are broken down below.
In Go, a defer statement will execute a function call just before the function it is called from returns.
I found that most of the examples of a Go defer call online seemed to do complicated things with numbers. So here is a nice simple example with just text output.
Example
You can run this code yourself in The Go Playground! You can also find a similar example in the Go Tour.
package main
import (
"fmt")
func main() {
// This will output first (in order) fmt.Println("One")
// This will output last (before this function finishes) defer fmt.Println("Two")
// This will be called before the above defer call "Two" secondary()
}
func secondary() {
// This will output after Four (before this function finishes) defer fmt.Println("Three")
// This will output (in order) fmt.Println("Four")
}
I make this post mainly for me to be able to look back at each year in a small snapshot. You can find similar posts for previous years in 2019, 2018 and 2017.
Recent Comments