Dani Rodríguez picture.

I'm Dani Rodríguez, but I'm usually known online as danirod.

I’m a creative software engineer living in Madrid, Spain, specialized in web development, who likes to play with web frameworks like Ruby on Rails, Django or WordPress. Online, I'm also known for being the founder and video producer at makigas.

This is my site, currently hosting my blog articles and linklog bookmarks. You may reach me via e-mail or XMPP (Jabber). You can also find me on Twitter, LinkedIn, GitHub, or through any of my social media profiles and online accounts.

Recent stuff

    If you’re working on a Git repository and your team makes exhaustive use of branches, every time you run git fetch, Git will download new commits on those remote branches, even if you don’t plan on having local branches tracking their remote pair. Once those branches are removed by your teammates in your remote repositories, git fetch won’t download new commits for those branches, but it won’t notify you that the branch has been removed either.

    If you want to remove remote branches in your local repository that have been already removed from the remote repository, you can run git fetch --prune. This will download new commits from existing or new branches, but also if a branch has been removed from the remote repository, you’ll have that branch removed from your local copy as well.

    If you don’t want to forget about prune, you can also configure your Git repository to automatically prune removed branches by running git config remote.origin.prune true. Replace origin with the name of the remote repository you have the setting to have effect on. Every time you run git fetch on that remote, deleted branches will get removed too.

    NandGame

    As seen this morning in Hacker News, NandGame looks like a cool game where you have to implement a circuit on each level. You start the game on level 1 without nothing but a NAND gate, and you have to build different logic gates and arithmetical circuits to pass to the next level.

    Requires a mouse, don’t know how will it work on touchscreens.

    I made a pre-commit hook that forbids committing directly to master or devel branches on Git. This is something that you don’t want to do if you find yourself working under some Git model such as GitFlow or GitHubFlow. Specially if you are using GitFlow. Specially if you are not alone in your project.

    Yes, I know that you can fix this after you make the commit by creating a new branch and then moving back the branch pointer for devel or master a few commits back, but I would waste less time if Git actually forbid me to make the commit in first place.

    #!/bin/bash
    
    FORBIDDEN_BRANCHES="master devel"
    BRANCH=$(git rev-parse --abbrev-ref HEAD)
    
    BOLD=$(tput bold)
    YELLOW=$(tput setaf 3)
    GRAY=$(tput setaf 8)
    RESET=$(tput sgr0)
    
    for branch in $FORBIDDEN_BRANCHES; do
     if [ "$branch" == "$BRANCH"  ]; then
      echo
      echo "${BOLD}You are currently in branch ${YELLOW}$BRANCH${RESET}."
      echo "    Committing from this branch would be a bad idea."
      echo "    Would you mind... changing to a different branch first?"
      echo
      echo "${GRAY}(Or you know, using the -n flag to bypass this message."
      echo " Hey, don't look at me! I'm a script, not a police officer!)"
      echo $RESET
      exit 1
     fi
    done
    

    You can also download the hook as a shell script. I don’t mind. It wouldn’t be that long if I didn’t declare all these variables but, hey, colors!

    The hook in action
    The hook in action. Note that I can still force the commit if I need or want to by using `git commit -n` (read the docs).

    Sometimes I wish we had something like SSHFS but for executable files.

    Yes, I’m aware of the ssh [hostname] [command] syntax. But, just like when you mount a remote file system using something like SSHFS or DAVFS, your local applications can interact with that remote directory without them ever noticing files are not actually in your computer (aside from the network latency), I just wish the same could be done with executable files.

    You run (or another application runs) ./hello, and that gets translated into ssh foo@192.168.4.4 /usr/bin/hello. stdin is piped to the remote server, stdout is piped from the remote server. It doesn’t matter if you are on a Mac and /usr/bin/hello is a Linux ELF binary file, because the file is actually executed on a remote server. A use case for this would be being able to run remote debuggers without having to rely on fancy IDEs that support this feature, such as debugging a remote Node.js or Python script in a server or in a Vagrant box.

    I guess the people behind Plan 9 actually had their point.

    Always read your PKGBUILDs

    If you don’t read the PKGBUILD file whenever you download something from the AUR repositories, you are exposing yourself to terrible security issues, as the world has recently seen.

    Malware was spotted in the AUR repositories of Arch Linux last week. Someone modified the PKGBUILD of a package to add a curl call in the script file, as can be seen here (as long as they don’t purge the blob object from the repository, because they stripped out the commit from the history).

    I would file this tip in the same category as “don’t just curl bash pipe stuff you find at GitHub”, but it’s getting late and I don’t have time for entering in the rabbit hole argument of where do we put the limit on trusting the software and the installers we put in our machines.

    TIL: Jekyll’s incremental builds do not trigger rebuilds of pages that make use of the site.posts variable, which means that, if you have a page that lists recent posts using site.posts, and you update a post, the page won’t be regenerated. This can be fixed by adding regenerate: true to those pages that you want to always be regenerated on each incremental rebuild.

    I make use of incremental builds to speed up the compilation time of my site in development mode, but I also have a lot of feed pages on my site, and it always drove me bonkers that my feed pages were not being regenerated, because apparently I didn’t see this footprint.

    Enough with the font smoothing

    I seriously condemn websites that change the font smoothing of blocks of text in their CSS styles. I seriously hate font-smoothing, -webkit-font-smoothing and -moz-osx-font-smoothing and I strongly believe that the world would be better if those goddamn’d properties didn’t exist. Ye, I understand that subpixel antialiasing doesn’t make sense on high DPI screens and that HDPI screens are usually better with grayscale scaling. But most websites change the aliasing in awful ways. Why can’t you apply a media query to only change the font smoothing on bigger displays? On my non-HDPI 1080p Dell display, grayscale antialiasing makes me want to rip off my eyes.

    Sandra

    Esta semana me he ventilado en mis trayectos en transporte público Sandra, una ficción sonora (en inglés) que habla de cómo podría ser la IA en un mundo paralelo parecido al nuestro. Son 7 capítulos y una de las voces la pone Kristen Wiig.

    Sandra

    I’ve listened this week to Sandra. It’s a fictional podcast located in a world where IA and virtual assistants are… slightly different than what we are used to. Kinda distopical at a few moments, but I’m sure after listening to the first episode you’ll want to keep listening. The entire seasion is available online so you can listen to it at once in an afternoon or in a few commutes.

    FTR, Telegram is not the proper alternative to WhatsApp or FB Messenger if you’re looking for something “open”. Just because the client is open source doesn’t make the cut, if the server is closed source, and I don’t understand why people don’t get this.

    Signal may be a better alternative since the server code is open source, although it’s not easy to rollout your own server because the official client has the central server address hardcoded and you’d have to fork the client as well.

    Another alternative is XMPP, although it doesn’t have a lot of traction, specially considering how modern chatty stuff such as ‘last online at’ or ‘read receipts’ depend on XEP extensions that have to be implemented by both the server and the client. Despite that, running an XMPP server nowadays is as easy as installing ejabberd, keeping sensible defaults such as making logins private, and using your Let’s Encrypt SSL certificate (yes it can be used!).

More posts in the archives »