Posts

Showing posts from January, 2021

Refactoring can be frustrating.

As I read through code I often rewrite it as I go, I find this helps me to understand it better. A bit like how doodling has been shown to help people remember stuff. I also take notes as extra comments as I go. Often after having gone through a bag of code I find that some of the edits I have made improve it. Ideally I could just create a new branch, merge request, go through the process and eventually get that code merged. One issue that comes up, and comes up particularly often on large refactor work is conflicts and conflict management. Now pycharm has a great ability to resolve a lot of conflicts but if the refactor is large enough to be moving whole collections of modules to a new architecture then simple side by side comparison of the changes doesn’t work. It can sometimes be hard to see how to integrate the new work. Alongside this is the fact that for large architecture sized refactor projects the process to get merge approval can take a long

Downloads manager

Image
Perhaps the best lunch-hour-python-project I have seen is that of the downloads folder manager. I originally saw this in a YouTube video of short python projects which unfortunately I haven’t been able to find again to link to here. I think almost everyone has a messy downloads folder, we download images, pdfs, programs and numerous other things that create a massively long list of items which can make it hard when going back to find things. I usually kept the folder ordered by most recently which worked quite well as a heuristic for what I wanted. The idea behind the downloads folder manager is that it watches for a file to get downloaded then based on some rules moves it away into one of a set of folders. As it’s a simple python script the whole thing is completely customisable and it’s easy to pick what folders you create. I am currently using the following script to manage mine: This sorts the downloaded files into the following categories; images,

Bathroom kit

Image
Both my girlfriend and I have electric toothbrushes, I also have an electric razor. Good for me so what? Like many bathrooms ours only have a single bathroom plug and as much as plugging and unplugging a toothbrush charger and razor stand is little effort, not having two toothbrush chargers is annoying. It would be nice to have all 3 plugged in so that we always had charged toothbrushes and I didn’t have to faff around with my replugging in my razor stand. Unfortunately, as easy as it would be to simply make a plug where they could all go in, to keep people who might go for a bath with a toaster bathroom safe,  plugs are incredibly limited in the amount of power that can be drawn from them. In fact just two toothbrushes charging is pretty much the limit! An easy solution would be not to store the toothbrushes in the bathroom and that way we could use an extension cable to charge everything, but that's a faff, the toothbrushes belong in the bathroom. As does the razor. I did try to

VIM controlled capslock

Image
One of the things I really appreciate about VIM is the modal style of text editing. It was the first text editor introduced to me that allowed you to edit in this style. When VIM was originally coded it used a keyboard where the escape key was where the capslock is on modern machines, this made it highly accessible while typing. Hence the escape key is what is by default used to leve the insert mode and enter the normal mode. The problem I found is that modern keyboards have the escape key quite far from having my hands on the home row and I have found it quite hard to hit it without having my hands getting lost. `1One solution to this is to use the mapping of ctrl+[ to escape from insert mode into normal mode. I find that this too is a bit of a faff. I found a better solution that works for me. jj I have mapped a double tap of the J key to escape, this allows me to easily move between the modes without having to move my fingers from the home row.

Faster youtube!

Image
 I like to consume content at faster than normal speed. With perhaps the exception of stephen fry reading the sherlock holmes collection I listen to all my audiobooks in faster than 2x speed. So to me it is a shame the youtube only offers 2x as the maximum speedup. I watch a lot of youtube and for me a lot of people, particularly on the longer more lecture style of content, just speek too slowly. I have recently found a way to pick the speed you have youtube at, picking any number you like! It does seem to be more buggy if you are playing the content at more than 3x but that is to be expected given we're using the system outside its designed range. It's also rare that even I can keep up with something at more than 3.5x. So how is the feat achieved? document.getElementsByTagName(“video”)[0].playbackRate = x You can use this as a bookmark by prefixing the url with "javascript:" If you save the following link in your bookmarks like I ha

Audible reading list 2020

Image
It's been a long year and as such, I've been able to get through a lot more audible than I have in previous years. Also as opposed to 2019 , I have actually read some books outside of those I have consumed on audible. This year I have got into the habit of buying textbooks. I find that in buying a textbook on a topic I have found a way to exploring the unknown unknowns within a field. This has certainly been the case with the software books I have purchased particularly software complete 2 which I have perhaps made most headway through.  I haven't read all of these, if I haven't put a comment I probably haven't read it. They are ordered in purchase order so the top 4 are to kick off the new year and have only just been downloaded.   Possible Minds By: John Brockman - editor Higgs

Popular posts from this blog

Structural engineering with cardboard

The twelve fold way