Categories
geek programming software tips tools

open a Git repositories’ website from the command line

Are you using Git a lot from the command line? Isn’t it annoying that you have to open a browser and click your way to the GitHub, GitLab or Azure DevOps repo website to create a pull request or do something else that can’t be done in your shell?
To solve that problem, I have a PowerShell function that opens the Git repository straight from your current folder in your shell, in your default browser. It checks the Git config for the origin URL, and opens it automatically. It’s super handy to quickly check the online repo, create pull requests etc.

Copy and paste the code below in a .ps1 script, and you’re set.

function Open-RepoInBrowser
{
    $url = git config --get remote.origin.url

    if ($url -like "*git@*")
    {
        # Get the URL from an SSH cloned repo.
        $url = $url -replace 'git@', ''
        $url = "https://" + ($url -replace ':', '/')
    }

    if ($url -eq $null) 
    {
        Write-Warning "No URL found. Make sure you are in the root of the Git repository."
        return
    }

    Write-Host "Opening URL $url"
    start $url
}

# Execute the function
Open-RepoInBrowser

Now navigate into a Git repository folder, run your script, and see that website open up in whatever your default browser is.
Note that PowerShell also runs on most Linux versions these days, so nothing is stopping you from using this easy shortcut.

Categories
breakcore dnb gabber hardcore jungle mp3 music

breakcore/jungle mix/dj-set archive

I have this folder with old breakcore/jungle mixes and dj-sets from around 2005 and later, when streaming from SoundCloud or whatever wasn’t a thing yet. Recently someone on Twitter was looking for an old mix I blogged about, so I figured I might as well put the old mp3 mixes I have up on archive.org, so anyone can find and enjoy them.

I’ve uploaded most of my breakcore mixes by now, and will be adding some more in the future. For search engines’ sake, I’m listing below what I’ve uploaded so far.

Categories
geek microsoft programming software tips tools

fix cascadia mono missing in visual studio without rebooting

Here’s a dumb problem I keep having on my work laptop. For some reason, Visual Studio 2022 shows me a notification that it can’t find the Cascadia fonts, and that a reboot will probably fix the problem.

That’s great and all, but I’m like in the middle of something and have a ton of other apps open and really don’t feel like rebooting right now (do we ever?). But being stuck looking at code in an ugly ass Courier font, isn’t what a self-respecting developer feels like doing either, right?

Last time I ran into this, I figured I might as well find the font and see if I couldn’t just reinstall it. VS should pick it up again after a restart. Turns out I was right. No reboot needed, here’s how you reinstall the Cascadia fonts on your machine:

  • Open the path C:\Windows\Fonts
  • Lookup the Cascadia fonts. There should be 2, CascadiaCode.ttf and CascadiaMono.ttf.
  • For each font file, double click it.
    A window will open, previewing the font. In the top toolbar, click Install.
  • Now restart Visual Studio. You’ll see your code represented in a pretty font once again.
Categories
fun geek opensource programming software tips tools

pimp your powershell with some ascii art

ASCII art in a PowerShell console window.

Wouldn’t you like to be greeted with some random ASCII art when you open up a new PowerShell command window? I thought so!

Here’s a project just for you. Download the ASCII Art Message of the Day project, link the script in your PowerShell profile and bam!, random ASCII art awesomeness every time you open a shell.

Follow the installation instructions from the readme f ile, and you are set. You can even customize what color you want to use. I know, it’s fantastic.
The random ASCII art comes from asciiart.eu, so check it out if you want to have an idea of what you’ll be getting.

Categories
photography software tips tools

fastest way to copy photos from a Sony A5100 camera

I love it when you can hook up peripherals, and they expose their files like a simple external USB drive. You already know how to copy files from a USB drive, so no need to install a new piece of software, and learn how to use it.

Unfortunately, a lot of peripherals do want you to install some fancy piece of software to import your files. The Sony A5100 camera is no different and wants you to install the PlayMemories software. I used it in the past, but it doesn’t bring me any extra value, so I’d rather not. This is how I export my photos now, and I guess this also works for similar Sony cameras.

  1. Hook up the camera using the USB cable to your PC.
  2. Power on the camera and select USB mode.
  3. Navigate to the \DCIM\100MSDCF folder on your camera’s USB drive.
  4. Copy the files to your hard drive.
  5. Delete the files from the SD card folder.

It works even faster if you have an SD card slot in your PC. In that case, put the camera’s card in your PC, and copy the files. Then put the card back in the camera.

Now we still have to restore the image database.

Because we removed the files manually, the camera’s image database needs to be reset using the settings menu. If you don’t do this, you’ll see missing images in the camera gallery. This makes sense because we just deleted them.

To reset the image database:

  1. Power on the camera.
  2. Go to the Settings menu.
  3. Use the Recover Image DB option.

There you have it, files copied neatly to your PC without needing the PlayMemories software. For videos, this doesn’t work, unfortunately. They are saved in a different format and need to be converted to mp4. In that case, I still use the software to extract the video’s to mp4’s.