~/devreads

#code

140 posts

8 Jun

5 Jun

4 Jun

3 Jun

2 Jun

29 May

28 May

27 May

26 May

25 May

Raymond Chen 2 min read

Putting them in a place that can access only if you call Start. The post A hypothetical redesign of <CODE>System.<WBR>Diagnostics.<WBR>Process</CODE> to avoid confusion over properties that are valid only when you are the one who called <CODE>Start</CODE> appeared first on The Old New Thing.

old new thingcode

22 May

21 May

20 May

15 May

14 May

13 May

11 May

8 May

7 May

6 May

4 May

1 May

30 Apr

29 Apr

28 Apr

24 Apr

23 Apr

22 Apr

20 Apr

16 Apr

15 Apr

13 Apr

10 Apr

9 Apr

8 Apr

6 Apr

3 Apr

2 Apr

30 Mar

26 Mar

25 Mar

23 Mar

19 Mar

18 Mar

17 Mar

16 Mar

13 Mar

12 Mar

11 Mar

9 Mar

6 Mar

5 Mar

4 Mar

2 Mar

27 Feb

26 Feb

25 Feb

24 Feb

23 Feb

20 Feb

19 Feb

18 Feb

16 Feb

13 Feb

12 Feb

11 Feb

9 Feb

6 Feb

5 Feb

4 Feb

2 Feb

30 Jan

29 Jan

28 Jan

27 Jan

26 Jan

23 Jan

22 Jan

21 Jan

16 Jan

15 Jan

14 Jan

13 Jan

29 Oct 2025

kevin 3 min read

Most browsers have the ability to launch different browser profiles. Each profile can come with a different theme and a different set of website logins (cookies, application state, etc). This can be helpful if you want to segregate browsing behavior. For example, I have different browser profiles set up for my personal email, my "consulting" […]

code

25 May 2025

kevin 1 min read

One of the first ever Redis libraries for Go was hosted at github.com/garyburd/redigo. It has been deprecated for some time and has now been finally removed altogether from Github. If you still have a dependency on this project, this means that will be broken now. github.com/gomodule/redigo should be a drop-in replacement for github.com/garyburd/redigo. If you […]

codetodays world

30 Dec 2021

Dan Brown 14 min read

Sara Soueidan is an independent Web UI and design engineer, author, speaker, and trainer from Lebanon. Currently, she’s working on a new course, "Practical Accessibility," meant to teach devs and designers ways to make their products accessible. We chatted with Sara about front-end web development, the importance of design and her appreciation of birds. The post Hacks Decoded: Sara Soueidan,…

featured articlefirefoxmozillaaccessibilitycode

4 Aug 2021

kevin 2 min read

When you sign up for Datadog, you are immediately asked to choose whether you want to have your data stored in US1, US3, or Europe. This is an odd UI decision because Datadog provides no other information about US1 and US3, for example, where they are located or how old the infrastructure is in each […]

codeconsulting

4 Sept 2020

kevin 10 min read

I finally got my home network in a place where I am happy with it. I wanted to share my setup and what I learned about it. There has never been a better time to set up a great home network; there are several new tools that have made this easier and better than in […]

codeeducation

3 Apr 2020

Brujo Benavides 3 min read

So, I just watched Michał Muskała ’s talk at CodeBEAMSF, and I have something to say… https://medium.com/media/111e462a24f172ad0b245a48d12b0a27/href As you might know, I’m also working with Juan Bono , Diego Calero , Facundo Olano , and others on our own formatter for Erlang (just like Daniel Tipping is working on steamroller ). I could write an article on how our formatter…

codeerlangprogrammingformatter

12 Mar 2019

17 Feb 2019

kevin 7 min read

Three years ago I quit my job and started consulting full time. It's worked out really well. I get to spend more time doing things I like to do and I've been able to deliver great products for clients. I wanted to go over some tips for starting a successful consulting business. Charge more - […]

code

20 Jul 2018

kevin 2 min read

Last week I wrote about how AWS ALB's do not validate TLS certificates from internal services. Colm MacCárthaigh, the lead engineer for Amazon ELB, writes: I’m the main author of Amazon s2n, our Open Source implementation of TLS/SSL, and a contributor to the TLS/SSL standards. Hopefully I’m qualified to chime in! You’re right that ALB […]

code

10 Jul 2018

26 Apr 2018

kevin 3 min read

Want to know how to get rough profiling of any tool written in any language, whether you control the source or not? Keep reading. For example, here's the output you get when you compile Go from source code. Each of these lines prints out a few seconds apart. How would you go about getting timings […]

code

4 Nov 2017

kevin 4 min read

It's a common, and distressing, pattern to have factories in tests that call out to a library like Faker to "randomize" the returned object. So you might see something like this: User.create({ id: uuid(), email: faker.random.email(), first_name: faker.random.firstName(), last_name: faker.random.lastName(), address: faker.random.address(), }); package = Package.create({ width: faker.math.range(100), height: faker.math.range(200), length: faker.math.range(300), }) This is […]

code

23 Oct 2017

kevin 4 min read

There are a number of Unix commands that manipulate something about the environment or arguments in some way before starting a subcommand. For example: xargs reads arguments from standard input and appends them to the end of the command. chpst changes the process state before calling the resulting command. envdir manipulates the process environment, loading […]

code

22 Oct 2017

kevin 3 min read

Bazel is a build system that was recently open sourced by Google. Bazel operates on configuration files - a WORKSPACE file for your entire project, and then per-directory BUILD.bazel files. These declare all of the dependencies for your project, using a language called Skylark. There are a number of Skylark rules for things like downloading […]

code

16 Oct 2017

kevin 3 min read

It's easier than you think to make a software package installable via Homebrew. If you depend on a very specific version of a software package (say, Postgres 9.5.3 with readline support), I highly recommend creating a Homebrew repository and publishing recipes to it. Then your team can install and update packages as easily as: brew […]

code

10 Oct 2017

1 Sept 2017

kevin 5 min read

Node string encoding is all over the place. Let's try to straighten out how it works. First, some very basics about string encoding. A string is a series of bytes. A byte is 8 bits, each of which can be 0 or 1, so a byte can have 28 or 256 different values. Encoding is […]

code

8 May 2017

kevin 6 min read

You might have heard that you shouldn't be using JWT. That advice is correct - you really shouldn't use it. In general, specifications that allow the attacker to choose the algorithm for negotiation have more problems than ones that don't (see TLS). N libraries need to implement M different encryption and decryption algorithms, and an […]

codedesign

28 Apr 2017

Henrik Warne 5 min read

In my experience, code can rot in two distinct ways. The first case is code that hasn’t been used in a long time, but where the environment has changed so it is no longer possible to run the code. In … Continue reading →

programmingcodecode rotquality

10 Apr 2017

kevin 5 min read

You should write your next web server in Go. Yes, you! Compared with Ruby, PHP, Python, or Javascript, you're going to get great memory and latency performance, and libraries that do what you expect. The standard library can be a bit lacking though, if you are used to developing with a tool like Rails. I […]

code

3 Jan 2017

kevin 4 min read

You may have seen this on New Year's Eve: Another leap second, another slew of outages. Handling time correctly is hard!https://t.co/kJepOfsKkv pic.twitter.com/Fwz2Xtpzkd— Dan Luu (@danluu) January 1, 2017 I'd heard a little about this problem, but I didn't understand how it broke code, and what to do about it. So here is an explainer. Background […]

code

27 Nov 2016

kevin 4 min read

A while ago my friend Alan and I were discussing configuration management. In particular we wondered why every configuration management tool has to ship a DSL, or be loaded from YAML files. We wondered if it would be possible to just write code that deploys servers — it might let you describe what you want […]

code

7 Nov 2016

kevin 6 min read

For the past few weeks I've been working on Logrole, a Twilio log viewer. If you have to browse through your Twilio logs, I think this is the way that you should do it. We were able to do some things around performance and resource conservation that have been difficult to accomplish with today's popular […]

codedesign

3 Sept 2016

kevin 4 min read

I have seen a few databases recently that could have saved a lot of space by being more efficient with how they stored data. Sometimes this isn't a big problem, when a table is not going to grow particularly quickly. But it can become a big problem and you can be leaving a lot of […]

code

3 Jul 2016

kevin 9 min read

I've been following the commits to the Go project for some time now. Occasionally someone will post a commit with benchmarks showing how much the commit improves performance along some axis or another. In this commit, they've increased the performance of division by 7 (a notoriously tricky number to divide by) by about 40% on […]

code

16 Jun 2016

kevin 3 min read

I have a lot of tests in Go that integrate with Postgres, and test the interactions between Go models and the database. A lot of these tests can run in parallel. For example, any test that attempts to write a record, but fails with a constraint failure, can run in parallel with all other tests. […]

codetodays world

7 Jun 2016

kevin 2 min read

Recently I put the maximum amount of cash into my IRA account. Since stock prices jump up and down all the time, I wondered whether the current price would be the best one to buy the stock at. In particular, I'm not withdrawing money from my IRA for the better part of 40 years, so […]

code

26 May 2016

kevin 5 min read

This is the story about an error that caused our tests to fail maybe one out of one hundred builds. Recently we figured out why this happened and deployed code to fix it. The Problem I've been fighting slow test times in Javascript and Sails since pretty much the day I started at Shyp. We […]

code

3 May 2016

7 Apr 2016

kevin 6 min read

Often the best way to learn a new language is to implement something you know with it. Let’s take a look at some common async Javascript patterns, and how you’d implement them in Go. Callbacks You can certainly implement callbacks in Go! Functions are first class citizens. Here we make a HTTP request and hit […]

code

12 Feb 2016

kevin 2 min read

This is a pretty common task: encode JSON and send it to a server, decode JSON on the server, and vice versa. Amazingly, the existing resources on how to do this aren't very clear. So let's walk through each case, for the following simple User object: type User struct{ Id string Balance uint64 } Sending […]

code

9 Feb 2016

kevin 2 min read

You might want/need to check out repos locally as several different Github users. For example, my Github account is kevinburke, but I push code at work as kevinburkeshyp. If I could only commit/push as one of those users on each machine, or I had to manually specify the SSH key to use, it would be […]

code

14 Jan 2016

kevin 3 min read

Recently there's been a trend in API's to return more than one error, or to always return an array of errors, to the client, when there's a 400 or a 500 server error. From the JSON API specification: Error objects MUST be returned as an array keyed by errors in the top level of a […]

codedesign

27 Dec 2015

kevin 5 min read

This past week the team at Shyp decided to fork the framework we use (Sails.js) and the ORM it uses (Waterline). It was an interesting exercise in JS tooling, and I wasted a lot of time on busywork, so I thought I'd share a little bit about the process. Why Fork? We've been on an […]

code

18 Nov 2015

kevin 5 min read

Do you have objects in your system that can be in different states (accounts, invoices, messages, employees)? Do you have code that updates these objects from one state to another? If so, you probably want a state machine. What is a state machine? At its root, a state machine defines the legal transitions between states […]

code

13 Oct 2015

kevin 9 min read

Adrian Colyer wrote a great summary of a recent paper by Peter Bailis et al. In the paper the database researchers examine open source Rails applications and observe that the applications apply constraints - foreign key references, uniqueness constraints - in a way that's not very performant or correct. I was pretty surprised to read […]

codeefficiency

26 Sept 2015

kevin 5 min read

There's a distressing feeling in the Node.js community that apps without up-to-date dependencies are somehow not as good, or stable, as apps that always keep their dependencies up to date. So we see things like greenkeeper.io and badges that show whether the project's dependencies are up to date (and, implicitly, shame anyone whose dependencies aren't […]

code

6 Sept 2015

kevin 7 min read

The Shyp API currently runs on top of the Sails JS framework. It's an extremely popular framework - the project has over 11,000 stars on Github, and it's one of the top 100 most popular projects on the site. However, we've had a very poor experience with it, and with Waterline, the ORM that runs […]

codedesignusability

31 Aug 2015

kevin 5 min read

Okay! You had an idea for how to improve the project, the maintainers indicated they'd approve it, you checked out a new branch, made some changes, and you are ready to submit it for review. Here are some tips for submitting a changeset that's more likely to pass through code review quickly, and make it […]

codedesignimprovement

25 Aug 2015

kevin 1 min read

Our test suite has been failing maybe 2% of the time with a pretty opaque error message. I thought the database logs would have more information about the failure so I figured out how to turn them on with Circle. Add the following to the database section of your circle.yml: database: override: - sudo sed […]

code

20 Apr 2015

kevin 6 min read

Our test environment takes 6-9 seconds to load before any tests get run. I tire of this during the ~30 times I run the test suite a day,1 so I wanted to make it faster. For better or worse, the API runs on Sails.js. Before running model/controller tests, a bootstrap file in our tests calls […]

codeusability

29 Nov 2014

kevin 3 min read

Recently I had a very weird problem with iTerm where new login shells were being created with environment variables already present. Restarting my machine made the issue go away, and I wasn't able to reproduce it again. But I got curious about how long ZSH spends in various parts of the startup process. A new […]

code

1 Aug 2014

22 Jul 2014

kevin 5 min read

You have photos on your computer. You would probably be really sad if you lost them. Let's discuss some strategies for ensuring that doesn't happen. What you are doing now is probably not enough. Your current strategy is to have photos and critical files stored on your most current laptop and maybe some things in […]

code

kevin 1 min read

You kick off a long running job - maybe a data migration script that operates on a large data set, or you're copying a large file from one disk to another, or from the Internet to your local computer. Then a few minutes in, you realize the job is going to take longer than you […]

code

4 Jun 2014

kevin 1 min read

It's important to recognize the people that have contributed to your project, but it can be annoying to keep your project's AUTHORS file up to date, and annoying to ask everyone to add themselves in the correct format. So I did what any good engineer should do, and automated the process! I added a simple […]

code

21 Apr 2014

kevin 2 min read

The Heartbleed bug was really bad for OpenSSL - it let you ask a server a simple question like "How are you" and then have the server tell you anything it wants (password data, private keys that could be used to decrypt all traffic), and the server would have no idea it was happening. A […]

codeeconomics

24 Mar 2014

kevin 3 min read

"Build software like a tank." I am not sure where I read this, but I think about it a lot, especially when writing HTTP clients. Tanks are incredible machines - they are designed to move rapidly and protect their inhabitants in any kind of terrain, against enemy gunfire, or worse. HTTP clients often run in […]

codedesign

29 Dec 2013

kevin 2 min read

This will be short, but it seems there's some difficulty doing this, so I thought I'd share. The gist is, any time you reference a class or method in your own library, in the Python standard library, or in another third-party extension, you can provide a link directly to that project's documentation. This is pretty […]

codeusability

20 Oct 2013

kevin 1 min read

Over on the Twilio Engineering Blog, I have a new post about optimizing your HAProxy configuration. I wrote this mostly because we had some confusion in our configuration about setting options, and if I had it I figured others would as well. Here's a sample: When I said a 30 second connect timeout meant HAProxy […]

code

31 Aug 2013

18 Aug 2013

kevin 2 min read

Recently I've fallen in love with the IPython Notebook. It's the Python REPL on steroids and I've probably just scratched the surface of what it can actually do. This will be a short post because long posts make me feel pain when I think about blogging more again. This is also really more about setting […]

code

13 Aug 2013

kevin 3 min read

Yesterday I sped up our unit/integration test runs from 16 minutes to 3 minutes. I thought I'd share the techniques I used during this process. We had a hunch that an un-mocked network call was taking 3 seconds to time out. I patched this call throughout the test code base. It turns out this did […]

codeimprovement

1 Jun 2013

kevin 3 min read

I really enjoyed Sam Saffron's post about eliminating trivial inconveniences in his development process. This resonated with me as I tend to get really distracted by minor hiccups in the development process (page reload taking >2 seconds, switch to a new tab, etc). I took a look at my development process and found a few […]

codeimprovement

17 Feb 2013

12 Feb 2013

kevin 3 min read

If you've ever tried to teach someone HTML, you know how hard it is to get the syntax right. It's a perfect storm of awfulness. Newbies have to learn all of the syntax, in addition to the names of HTML elements. They don't have the pattern matching skills (yet) to notice when their XML is […]

codeimprovementusability

29 Jan 2013

kevin 6 min read

I've worked with Twilio's client libraries pretty much every day for the last year and I wanted to share some of the things we've learned about helper libraries. Should you have helper libraries? You should think about helper libraries as a more accessible interface to your API. Your helper libraries trade the details of your […]

codeusability