News
Bazel and Gopls
So Bazel and the Go language server gopls don’t get along very well. The problem is that Bazel generates a bunch of bazel-\* directories that gopls then tries to process, which can cause gopls to produce a slew of invalid warnings, run slowly, and sometimes even crash. The solution I’ve found so far is to add the following to my .bazelrc file:
build --symlink_prefix=_bazel_ test --symlink_prefix=_bazel_ # Also suppress the generation of the bazel-out symlink, which always appears,no # matter what you set --symlink_prefix to.
News
Islands of Data
This demo of a shopping list in the 1968 “Mother of All Demos” with Doug Engelbart & Team is both amazing and depressing all at the same time:
We have at least progressed to the point where assembling such an application is a training-wheels level exercise used to introduce different web frameworks. For example, here’s a tutorial from Mozilla on how to write a TODO list application in four different frameworks: Introduction to client-side frameworks
News
Booleans
I have come to consider boolean function arguments as a bit of an anti-pattern.
Consider the following function:
package hex // ConvertFileToHEX write the hex representation of the src file // to the dst file. If uppercase is true then write the HEX // values in uppercase, otherwise write then in lowercase. func ConvertFileToHEX(src, dst string, uppercase boolean) error { ... } This seems like a completely simple function that’s easy to understand, but that’s when you are looking at the function definition, but most of the time you won’t be look at the function definition, instead you will be looking at that function being called from code, i.
News
Default Margins for Flexbox Elements
So I have been frequently frustrated when doing CSS flexbox, in particular, my margins, which may look good on a wide screen suddenly look awful as the screen narrows. Instead of using media queries to change the CSS on narrower windows I began to wonder if I was just missing something basic, so I took some time to back up and think about the problem in general, and I can up with the following default system:
News
2021
I keep seeing people anxious for the end of 2020, as if January 1st was a Rubicon that the shit-storm of 2020 won’t follow us across.
Let me disabuse you of any such notion.
Really, what do you expect to change in 2021?
Will global warming be solved? Will corporate concentration disappear? Will income inequality be solved? Will structural racism vanish overnight? Do you expect the GOP to suddenly disavow Trump, back away from fascism, and relinquish Q-Anon?
News
Turkey Recipe
Here's my Roasted Turkey recipe. Click on any picture to bring up the lightbox with captions. new LuminousGallery( document.querySelectorAll('.gallery'), { arrowNavigation: true, }, { caption: function (trigger) { return trigger.
News
Thoughts on the Election of Joe Biden
Thoughts on the election of Joe Biden.
First, let’s admit it’s pretty amazing that Biden won. If you look historically at US Presidential elections all the forces were tilted toward a Trump win:
Trump was an incumbent, which is a huge advantage.
The economy was doing good.
We had a national catastrophe (Covid) and Americans traditionally rally around the President when faced with such adversity, just think of Bush’s rise in popularity after the 9-11 attacks.
News
Thoughts Before the 2020 Election
Some random thoughts before the final day of voting in the 2020 US Presidential election:
At least now more people realize the importance of politics. “How bad could it be?” may have gotten him into the office, but “Oh, that bad!” will probably remove him.
The press, at least the legitimate press, like CNN and the NYTimes, finally overcame their crippling addiction to falling for every single Trump troll.
News
The Unreasonable Effectiveness of Customer Data
Here are two great talks by Google engineers on dealing with large sets of data and how they can be used to improve your product.
The first is a talk by Peter Norvig - The Unreasonable Effectiveness of Data:
The point of the talk is that having more data is better than having a more clever algorithm.
And you can see this in action in this second talk by Douglas Merrill.
News
Referrer Policy
This is a reminder from the running-just-to-stay-in-the-same-place department that if you run a blog you probably want to set a Referrer-Policy header:
Referrer-Policy: unsafe-url Chrome MDN This notice brought to you by the “What broke my webmention implementation this time?” department.
News
Shadow Dom Example
We need to talk about Shadow DOM. While the Google official docs strongly encourage the use of Shadow DOM, I quite strongly disagree.
As an example, a couple weeks ago I realized I could style the <summary> part of a <details><summary> set of elements as a button, which would look great and more readily indicate its function. You can see the improvement here:
Before:
After:
Thankfully I hadn’t swallowed the party-line on Shadown DOM and this is the full set of CSS changes I had to make, just the following additions:
News
Creating a Date Column in Notion That Has a Default
I searched around for a while on how to create a Date column in Notion that defaulted to the current date and time but could also be editable. I didn’t find anything useful and eventually came up with my own solution.
This requires three columns:
The first column is the Created column which exists by default on tables. The second column is a Date column named Override Date. This will normally be empty unless you enter a value in the column.
News
Efficient is the antonym of Robust
In Just Too Efficient, Tim Bray gathers a good set of links and arguments about efficiency.
As I’ve said before:
"Efficient" is the antonym of "Robust". https://t.co/a05rUC5XKE
— Joe Gregorio (@bitworking) April 23, 2020
News
Public Service Announcement: Wealth Induced Tech Bro Sociopathy
Do you, or someone you know, suffer from the following symptoms?
Willful ignorance of history because doing otherwise might impact your bottom line? Mark Zuckerberg
Do you equate self-driving cars with dismembering journalists? Uber
Do you take umbrage at women’s suffrage? Peter Theil
Is your name Marc Andreessen?
Then you might be suffering from Wealth Induced Tech Bro Sociopathy, an old disease currently experiencing an outbreak in Silicon Valley.
News
Time Crimp
Defn: Time Crimp, Temporal Crimp, or simply Crimp A term that describes the compression of time during a crisis. During times of crisis events unfold with a speed unthinkable outside a crisis. Vaccines for Covid-19 may be available in a year or two, as opposed to the normal development timeline of decades. Sweeping changes to zoning laws that would normally have been impossible, or at least taken years to get approved are done in a matter of days.
News
Murkowski
Murkowski verb
To express "concern" about something you have no intention of doing anything about. Derived from Senator Lisa Murkowski who claimed she was "concerned" about about President Trumps behavior but still decided to vote against impeaching him. Four months later Trump was tear-gassing peaceful protesters. Example usage: "Wow, Zuckerburg totally Murkowski'd on Trump's violent rhetoric." See also: Duplicitious.
News
go2ts
go2ts is a simple and powerful Go to Typescript generator. It can handle all JSON serializable Go types and also has the ability to define TypeScript union types.
Written because none of the existing solutions did what I wanted.
This code originally started from struct2ts when I started writing a PR to add the features I wanted, but after adding unit tests, cleaning up the code to meet our internal standards, and removing features temporarily so I could more easily understand the code, I realized I only had a handful of lines in common with the original project, so I instead forked it into its own project.
News
Chana Masala Recipe
Here's my Chana Masala recipe. Click on any picture to bring up the lightbox with captions. ul.recipe { display: flex; flex-wrap: wrap; } ul.recipe li { list-style: none; margin: 8px; } .lum-lightbox-caption { color: white; background: black; font-size: 150%; padding: 16px; } new LuminousGallery( document.
News
Spinach Rice Recipe
I've seen Spinach Rice recipes where the spinach is all bright green and fluffy and the rice is brilliant white. That is wrong, and this is not that recipe. If you cook this right the chicken stock combined with the Dill Weed and the carmalized onions will give the dish a nice meaty taste. Click on any picture to bring up the lightbox with captions. new LuminousGallery( document.
News
Pizza Dough Recipe
Doughs really aren't that difficult or finicky, start with some warm water and yeast and mix in flour until you get the right consistency, no precise measuring or scales needed. Click on any picture to bring up the lightbox with captions. new LuminousGallery( document.