Snippets

SNP 001–148

Loosely organized collection of code snippets. Maybe you'll find something useful here.

Showing 20 of 148 snippets

  1. SNP 028 #945

    Python virtual environments

    Keep every project's packages to itself.

  2. SNP 027 #4B7

    Change the last commit message

    Fix a typo in the commit message you just wrote.

  3. SNP 026 #513

    Crisp pixel art in CSS

    Browsers smooth scaled images by default, which turns pixel art into mush. One line fixes it.

  4. SNP 025 #A42

    Clean up Docker disk space

    Docker quietly ate 40 GB of my disk. Here is how to get it back.

  5. SNP 024 #936

    Find duplicate rows in SQL

    Which emails are in the users table more than once?

  6. SNP 023 #159

    SSH config aliases

    Stop typing [email protected] -p 2222 every single time.

  7. SNP 022 #B31

    Debounce a function in plain JavaScript

    Run a function only after the user stopped typing, without pulling in a library for it.

  8. SNP 021 #24B

    Find the largest files and folders on linux

    The disk is full again. Here is how to find what is eating it.

  9. SNP 020 #614

    Undo the last commit but keep the changes

    Committed too early? Take the commit back without losing any work.

  10. SNP 019 #395

    Kill the process that is using a port

    Find out what is squatting on port 3000 and get rid of it.

  11. SNP 018 #35B

    LLM Prompt for refactoring your codebase using best practices

    Sometimes you just want to have better and more maintainable code.

  12. SNP 017 #924

    Auto order episodes of Buffy the Vampire Slayer and Angel

    Order the episodes of Buffy the Vampire Slayer and Angel automatically to the "best viewing order"

  13. SNP 016 #156

    Solve Bitbucket SSH-RSA connection issue

    How to solve permission denied or no mutual signature algorithm errors while connecting to Bitbucket.

  14. SNP 015 #B96

    Create timeout in an async function

    To throttle the execution of our async function we will create a timeout method.

  15. SNP 014 #52B

    Auto mount Samba share on startup in Manjaro

    Mount your Samba network share on startup. It even works when you are using WiFi.

  16. SNP 013 #249

    Get query parameters in Nuxt

    Read the GET request query parameters in your code.

  17. SNP 012 #951

    Concat IDs into a single field in SQL

    Here is how to merge multiple SQL rows into one, values separated by a comma.

  18. SNP 011 #419

    Add more VSFTPD virtual user accounts

    How to add more virtual user accounts to your VSFTPD on linux.

  19. SNP 010 #2B1

    Mount samba share on Ubuntu 20.04 server

    How to mount samba shares on the latest Ubuntu LTS release.

  20. SNP 009 #65B

    Compress and extract TAR files on linux

    How to compress and extract TAR files on linux with gzip easily.