Programming My Life - til
  1. [TIL] Shell Alias for Failing Commands

    TL;DR: Instead of && use ; after a command that might have errors.

    My main project at work has a nice Make command for getting a new truncated version of our main database. Unfortunately, I can never remember the exact command, and it requires a second command (pg_restore) to update my …

  2. TIL: Docker Commands

    I set up my main project at work to utilize LocalStack this week. I wasn't able to get it working using a virtual environment with Python, but another project at work has it set up through Docker. A coworker that is much more familiar with Docker than I am helped …

  3. [TIL] Mocking Chained Calls

    At work last week, I was asked to write tests for code that reaches out to Twilio's verify service. Here is what that code looks like (from the Twilio docs):

    client = Client(account_sid, auth_token)
    
    verification = client.verify \
                         .v2 \
                         .services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
                         .verifications \
                         .create(to='+15017122661', channel='sms')
    

    I was able to …

  4. [TIL] Django Admin Permissions, etc.

    So far in my main project (more on that to come), the only users of the admin have been myself and my cofounder, so I've made us both superusers. Recently, I had a request to allow an instructor to view and update data from their own courses. This would require …