Jared Picou

Life. Tech. And the pursuit of happiness.

Author: Jared P.

  • New Year – New Hobbies – 2025

    As much as I enjoy computers and tech, I don’t interact with them outside of work very often. After working on a PC all day, I tend to stay away from them outside of work unless it’s a necessity. This allows me to take a break from the keyboard and screen and explore other things to fill in the remainder of my day, night, and weekends.

    But due to my indecisiveness and curiosity, it’s led me to having many hobbies all at once. This can be a good thing, but it leads to limited time and money to invest in any single hobby, keeping me at the ‘beginner’ stages of basically everything I try. Then I’m apprehensive about spending more on a single hobby because I’m not sure I’m really interested enough to do so and fear it will be a waste of resources.

    In 2025 I hope to fix this or at least come up with a plan to resolve it. First, I’ll look at hobbies I’ve dabbled in for 2024 and determine if it’s worth investing more time and money into them. Then with this information handy, I’ll “limit” the hobbies I engage in for 2025, allowing a better use of time and money.

    Music

    This is a hobby I plan on sticking with until further notice. I play a role in a local community band and recently changed from trombone to bass guitar. I enjoy it very much and I do hope to either purchase a new 4 string bass or fix up my 5 string to play with this group. I also may be tutoring young trombone players if it works out, so I don’t want to give this up and probably should prioritize this over other hobbies.

    Video Games

    I feel like I’ve cut back a lot on video games, but I do still spend a lot of time playing them. I tend to play them in the evening or between other tasks throughout the day as a break, usually with a cup of coffee or something. I plan on cutting back more this year and playing them only on the weekends. I don’t spend much money on them these days and I’m trying to replace it with more productive tasks.

    Cooking

    I’ve picked up the habit of cooking my lunches for work every Sunday. This has saved me a lot of money and sodium intake over the last few months since I don’t have to rely on takeout every day at work. I really enjoy spending time learning and trying new recipes and I’m at the point that everything I cook is edible at the least. I also received a dedicated chef knife for Christmas, so I intend on continuing this journey this year. I don’t really consider this a “hobby” but it’s something that I did put in time and money into this year that should be considered on this list.

    Homebrewing

    I really enjoy homebrewing but it’s very time consuming. With the cleaning of equipment and brew days reaching 5-6 hours of commitment, it’s just not something I have time for right now. I have all of the equipment I need so I only have to pay for the materials to make each batch. I also don’t really “need” 48 bottles of beer for myself. Friends are just as busy as I am these days so finding brewing buddies is also difficult. I’m not to the point of getting rid of my equipment but I think in 2024 I only brewed 2 or 3 times.

    Instrument Repair

    Despite my high level of interest in this topic, I don’t have a great shop setup to do this right now. This was supposed to be a solution to make some side money that wasn’t computer related, but it would take a considerable amount of time to learn and do, which I don’t have right now. I’d like to revisit this in the future once my shed is better equipped to handle the materials and tools needed to do this. Without a mentor on this topic near me, it’s going to be very difficult and time consuming to become proficient enough at this to make it worth the time and money involved.

    Youtube

    I guess I need to consider this a hobby with as much time as I’ve put into watching Youtube. I don’t watch much traditional TV other than the occasional game show, sports match, or old TV series that’s on just for noise while I play on my phone. Youtube engages me more and I do learn a lot from it, but I also spend a lot of time watching others play games, eat food, and do things that I should be doing myself. This year I want a lot less Youtube time and more doing time.


    As I write these, I see is that a lot of these hobbies just didn’t fit my schedule or provide a true purpose other than a hit of dopamine. Most of my evenings spent on video games and Youtube can probably be easily replaced with something much more useful and meaningful. I enjoy learning new things, but I should be putting more into practice, not just learning about it and never doing it.

    For this year I’m trying something different, by providing a meaning to what I’m doing instead of doing things just do it or out of habit.

    Music (still)

    With my transition to bass guitar as well as a potential idea to tutor on trombone, I want to continue putting in the effort to become more proficient in music. Music theory will probably take center stage this year as I continue to teach myself bass guitar. We also now have a nice keyboard in the house, so I’d like to learn enough to help my daughter along with that topic.

    I should incorporate at least 15-30 minutes a day on music, whether it’s playing it or studying it, including weekends when time and duties allow it. I also want to spend some time on setting up my 5-string bass and get it playing sooner than later.

    Reading

    I really should read more. I have a Kindle that does not get used enough, and a new library near my house that I would like to utilize more. I listen to audiobooks daily, but I feel reading is such an important aspect that I should keep it high on the priority list. I can easily replace morning phone time and evening Youtube/video game time with reading. I should be reading more of both fiction and non-fiction.

    Cooking

    After getting the hang of the basics, I want to explore cooking more. I enjoy making things from scratch and need to more of that. This year I hope to learn more about sauces and get more practice with homemade bread and pasta. Maybe towards the end of the year I’ll buy the equipment to make my own homemade sausage and smoke it. But for now, the goal is to continue to make better food for myself and my family.

    Exercise

    I’m putting this as a “hobby” even though it should be in everyone’s standard list of things to do. I don’t exercise the way I should and as I get older, I am really starting to feel the effects of it. Cooking healthier meals and intermittent fasting is only going to get me so far, I simply need to move more. I plan on purchasing some sort of equipment that allows me to do some simple exercising from the comfort of my home. I tried the Total Gym, but I don’t like it, so I need to quickly move away from it and try something else. Walking falls into this category as well so I hope to add both to my routine.

    House Maintenance

    One of the things that stops me from making improvements in my home is lack of confidence that I can do it and make it look acceptable. The only way I’ll get to that point is if I continue to practice these skills. I need to put in shoe moldings, paint, and prepare for better kitchen countertops and a sink this year. I’d like to do as much as I can myself and learn along the way, so I am more confident in my abilities here.

    Woodworking

    I was going to group this House Maintenance but my goals with this are different. I want to learn enough about woodworking to create things I need, such as worktables, sawhorses, side tables, and other functional pieces of furniture and equipment. I also would like to find things that I can sell locally. This may scratch the itch of finding a non-computer hobby that could potentially pay for itself over time. This is what is motivating me to clean out and reorganize my shed to make a makeshift wood working shop.

    Summary

    This approach should eliminate some of the not so useful hobbies I got into in 2024 and replace them with more meaningful and useful hobbies in 2025. All of them should improve myself in some fashion, whether it’s by experience or knowledge. Some of these are low costs such as music and reading, allowing other funds to be put towards hobbies that do cost, such as exercise and woodworking.

    I hope to check back on this post each quarter to see how these ideas have held up over time.

    Happy New Year 2025!

  • How to use snippets to save hours of typing in Azure Data Studio

    Working with ad-hoc queries on a daily basis can lead to a lot of wasted keystrokes if you are not careful. And I mean a LOT of wasted keystrokes. Snippets assist with this by allowing you to make customized, reusable queries (or pieces of queries) that you can recall quickly and efficiently.

    Initial Setup

    Microsoft will do a much better job explaining the setup of these snippets. Here’s a footnote 1 that showcases the setup.

    After this initial setup, a new JSON file is made that will hold your snippets. To access this file for configuration through Azure Data Studio, in the Settings cog at the bottom left corner, there’s an option for User Snippets. Click this and choose the Existing Snippet of sql.json. The Microsoft article also provides an example layout of a snippet to use as a guide.

    This idea can also be applied to SSMS and I’m sure many other query editors, but Azure Data Studio is what I’ve been using lately so I’m writing this based on it. The setup and editing process may be different for each application. Check each application’s documentation to confirm how the setup should take place.

    Using the JSON File

    You can think of each snippet as an entry in this JSON file. Each snippet is organized as this:

    "Snippet Name":{
      "prefix": "",
      "body": [""],
      "description": ""
    }

    The Snippet Name is the simple name of your snippet. It’s good to give each snippet a descriptive name that helps you recognize what it does and contains some regularly used key words.

    The snippet’s prefix is the shortcut you can type in the SQL query editor to utilize the snippet. This can be different than the snippet name if you want to use abbreviations or some other method to call these snippets.

    The snippet’s body is where the actual script is put. The body contains multiple lines, each wrapped in double quotes, inside of brackets. When calling the snippet, it will appear exactly as you have it organized in this section.

    Related to the body section, there are also placeholders that can be added to the script. This is great to use where you know you need to add a variable for the script to function properly. I’ll put an example of this later.

    The snippet’s description is however much explanation you want to add to the snippet. When choosing a snippet, the description will appear next to it, further describing what it does.

    Example Snippet

    Let’s say I have a query that I use to check a user’s account before making changes to it. I don’t need to see all columns, only the ones I’m interested in. So, my query may look like:

    SELECT
      uProd.username, 
      uProd.email, 
      uProd.lastLoginDate, 
      uStat.statusDesc, 
    FROM
      current_Users_Production uProd
      LEFT OUTER JOIN users_Status uStat 
        on uStat.statusID = uProd.statusID
    WHERE
      email = '[email protected]' 

    While it’s not complex, it will still take me a minute or two to write this out each day and format it to my liking to run it. Of course I could save it in a .sql file and load the file each day to run it. Personally, I don’t care for managing a lot of individual .sql files for simple queries that do not require a lot of logic. This particular query would benefit from being a snippet instead.

    The snippet would look something like this:

    "CheckUserInProduction":{
      "prefix": "prod_chkusr",
      "body": [
        "SELECT"
        "  uProd.username,"
        "  uProd.email," 
        "  uProd.lastLoginDate,"
        "  uStat.statusDesc," 
        "FROM"
        "  current_Users_Production uProd"
        "  LEFT OUTER JOIN users_Status uStat"
        "    on uStat.statusID = uProd.statusID"
        "WHERE"
        "  email = '[email protected]'"
      ],
      "description": "Review user information before updating."
    }

    Once I save my sql.json file, I can then open a new query window, type ‘prod_chkusr’, press Enter, and this script appears just as is, saving me all of that typing!

    If it takes me 2 minutes to write this query every day for 5 days each week, then I just saved 40 minutes a month. This may sound insignificant, but we should consider how many daily or common scripts we write every day that can become a snippet. 40 minutes could easily turn into 4 hours a month, which can be put towards more important tasks or coffee breaks.

    Using Placeholders

    Referencing the above example, there’s a piece of information that I need to fill in for the query to function, the Email parameter in the WHERE clause. After inserting my snippet, I will need to click here, highlight it, and retype the email address that I’m actually interested in. That’s where placeholders shine.

    Instead of putting ‘[email protected]’ in my snippet, I can replace it with a placeholder. Placeholders are formatted as:

    ${number:label}

    The number is the tab stop number. A placeholder with a number 1 will be the first location of the cursor when the snippet is inserted, then 2, then 3, etc. A placeholder with a number of 0 will be the last stop after all of the other stops are cycled through.

    The same number can be used in multiple places as well. Let’s say I had a UNION query that needed this email address to be placed in two WHERE clauses. I can put the same placeholder number in both locations so when I fill one in, the other is filled in automatically.

    The label is just a description of what the placeholder should be. In our case, since I only have 1 parameter and I need it to be an email address, I could replace my WHERE clause with the following:

        "WHERE"
        "  email = '${1:userEmailAddress}'"

    When I insert the snippet in my query editor, this will be highlighted for me immediately (due to the tab stop number 1) to type the email address I’m interested in. Using placeholders strategically can add good flexibility to snippets.

    Snippet vs Stored Procedure

    There are times where keeping a reusable query is better in a Store Procedure or Function. To help differentiate between the two, think of snippets as time saving tools made just for you and your own method of work. They will contain queries that you personally use often and organized in a way that makes the most sense to you.

    Stored Procedures and Functions are stored in your database and allow other users and programs to access them if needed. Snippets are stored locally on your workstation and are only available to you, unless you purposely share them elsewhere. This is also true with backups where stored procedures and functions are typically backed up with the database. The sql.json file is backed up based on your workstation’s backup procedures.

    Backing Up your sql.json File

    As I began to rely heavily on my snippets, I found that the sql.json file that holds them all is quite valuable to me. Yes, I could recreate my snippets over time for myself, but that would (of course) take more time.

    To keep things simple, I use a batch file to copy my sql.json file from my PC to my secondary hard drive as a backup location. Your operating system may achieve this differently, and I’m sure there are many ways to do this. If don’t have a backup system in place on your PC and you just want to backup this individual file, you could use Task Scheduler to run this batch file once a day. It just keeps a single copy of the file in a different location.

    $sqlJSONFile = "C:\Users\<yourname>\AppData\Roaming\azuredatastudio\User\snippets\sql.json"
    $sqlJSONBackup = "<your backup location>\sql.json"
    
    Remove-Item -Path $sqlJSONBackup
    Copy-Item -Path $sqlJSONFile -Destination $sqlJSONBackup

    In this example, you would replace <yourname> with your username and <your backup location> with where you want to save the file at.

    Putting it to Use

    Making the snippets in Azure Data Studio is not complicated but utilizing them correctly can be challenging at first. Each person will utilize them differently, so it’s up to you to find the best way snippets can fit in your day-to-day duties working with queries. Once your system is setup, you’ll be shocked at how much time and typing you’re saving by utilizing snippets.

    Try this exercise to get started with snippets and start reaping the benefits:

    • For week 1, keep a simple log of all of the ad-hoc queries you write throughout each day. Anything that’s not saved in a .sql file or in a stored procedure / function can be considered an ad-hoc query.
    • At the end of the week, review the log and find the 3 queries that you ran the most times. These are great first candidates to become snippets!
    • Make each of these queries a snippet in your sql.json file. Look at them objectively and come up with good names, prefixes, formatting, and placeholders for each.
    • For week 2, start using these 3 snippets in your daily work, but continue to keep a log of your other ad-hoc queries (not counting the ones already in your snippets file).
    • At the end of week 2, once again add the top 3 ad-hoc queries to your snippets file.
    • Continue to week 3 and 4 using the same procedure.

    By the end of week 4, you should have (hopefully) 15 snippets to utilize each day that no longer need to be typed over and over again. If you find that you’re still typing a lot of ad-hoc queries, repeat the exercise and continue to build your snippet library to your liking.

    Didn’t come up with 15? Don’t worry! That just means your ad-hoc queries that month were not very repeatable and maybe not needed as a snippet. Try the exercise again when you feel that you’re typing the same thing over and over again

    I hope this idea has saved a little time in your day, added some organization to your scripts, and provided some inspiration to find other efficient practices.

    Resources

    1. https://learn.microsoft.com/en-us/azure-data-studio/code-snippets#creating-sql-code-snippets ↩︎