Live data from Hacker News

Ask HN: What are some tools / libraries you built yourself?

news.ycombinator.com

481–490 of 617 posts

Re: Ask HN: What are some tools / libraries you built yourself?

#481
post #109

I made a crappy little web tool[1] that lets me paste a timestamp into it, and will show me that time in my current timezone by default (I think that's just hardcoded haha), or in another one that I select. I mostly use it when reasoning about logs -- for some reason my mind has never gotten used to mapping UTC time to my time. It also has a selector for the source timezone, but that doesn't work, for reasons I've fo…

Cool simple tool! :) I think the reason the source zone might not work (and I'm not an expert, and date times in code are hard), is that all "timestamps" are in Zulu / GMT0 time, so it won't make sense if you try to source a Zulu time from like Hawaii time or whatever.

That was a good guess! Your comment provided some helpful motivation to go look into it. :)

It seems to have actually been a typo-misuse of moment.tz's very similar but very different constructor patterns. To illustrate, imagine we have a date "2020-01-01", an offset tz "America/Vancouver", and "America/Toronto" as the locale's timezone.

moment(date).tz(offset) says "interpret date in its given tz, falling back to the locale tz if not given, then reinterpret it via the offset tz". So the date "2020-01-01" with no encoded tz data is interpreted as midnight in the locale's tz, America/Toronto. That is then reinterpreted in the offset timezone America/Vancouver, so calling .format() on it gives the result "2019-12-31T21:00:00-08:00" -- midnight on New Year's Eve in Toronto was 9 PM on Dec 31st in Vancouver. Offset here is changing the output, not the input.

moment.tz(date, offset) says "interpret date in its given tz, falling back to offset as the tz if not given". So the date "2021-01-01" with no tz data is interpreted as midnight in the offset tz, "America/Vancouver". Now calling .format() gives "2020-01-01T00:00:00-08:00", or midnight in Vancouver, which would be 3 AM in Toronto.

Glad to have it fixed.

Re: Ask HN: What are some tools / libraries you built yourself?

#482
I wrote the Tango web iframe framework which helps to orchestrate micro clients on a cross origin page.

The use case is for companies to securely offer experiences as integrations to other websites, such as a live chat, comments sections, payment modal, etc.

It turns iframes into something that resembles React components (though you can use any framework inside them).

It's tiny (~7kb), fast, and has no external runtime dependencies.

I'm very proud of it but I haven't open sourced it yet. A little scared to.

Re: Ask HN: What are some tools / libraries you built yourself?

#483
I built Accelerator Keys, a niche tool replicating Windows accelerator key shortcuts in Mac Excel [0]. I made it to scratch my own itch at first, as accelerator keys are a much more intuitive and faster way to use a shortcut intensive app like Excel. Before this, power users needed to run a full VM and use Windows Excel if they wanted to use these shortcuts. It seemed like overkill to me.

Last year, I decided to take the leap and try selling my first piece of software. Here's the PH launch from a few months ago [1]. It's not easy tracking down users, but I've managed to sell a few hundred licenses so far.

It has been a fruitful journey. Learned a lot while building it (e.g. about accessibility features on Macs), but making this a product also meant learning about licensing, payments, front end for the landing page, SEO and FB ads.

[0]: https://acceleratorkeys.com

[1]: https://www.producthunt.com/posts/accelerator-keys

Re: Ask HN: What are some tools / libraries you built yourself?

#484

I'm building a general-purpose data format for the modern age. The old ones are too bulky, too insecure, and too limiting. * Secure: As a tightly specified format, Concise Encoding doesn't suffer from the security problems that the more loosely defined formats do. Everything is done one way only, leaving less of an attack surface. * Efficient: As a twin binary/text format, Concise Encoding retains the text-based ease…

The pitch sounds a lot like that for Amazon Ion: https://amzn.github.io/ion-docs/

Similar, yes, but Ion repeats a number of mistakes from the past:

* The text format doesn't have a version specifier, so any future changes to the text format will break existing codecs and documents.

* Uses ISO 8601, which has bad defaults (local timezone) and doesn't support real time zones (only offsets). ISO 8601 is also too big for what it does and non-free, resulting in inconsistent implementations (and thus security problems).

* Doesn't support chunking (so you must always know the full length before you start encoding).

* Lists must be prefixed with their length, so you must know the length before you start encoding. Converting a list from the text format to binary format would require loading the entire list into memory first.

* Only supports "struct" encoding, so you can't have real maps (for example using integers or dates as keys).

* Doesn't support arbitrarily long scalar values.

* Doesn't support NaN or infinity.

* Doesn't allow to preserve comments when converting to binary.

* Doesn't support arrays.

* Doesn't support recursive data or references.

* Doesn't have a URL or UUID or error type.

* Integer, date, and decimal float encodings are inefficient.

* Allows multiple sections, each with their own version declaration as a feature for mixing specification versions in the same document. This means that ALL codecs must support ALL versions forever, increasing bloat and attack surface.

Re: Ask HN: What are some tools / libraries you built yourself?

#485
A couple of years ago, I went to work in SF area and I switched my dev environment for MacOS.

On my free time I love to do some apps and when I started to learn Swift and Cocoa, I got tired of dealing with same things with platform specific complicated stuff.

I decided to build by own GUI tool, written with the Go programming language.

A couple of iteration later (years), it became a WebAssembly library for building progressive web apps.

It is named go-app and you can see how it look like with this dogfooded documentation website: https://go-app.dev

If you like lofi music when working, or you are a fan of World of Warcraft game, there is those 2 others ones built with this package: https://lofimusic.app and https://murlok.io

Hope you find it interesting :)

Re: Ask HN: What are some tools / libraries you built yourself?

#486
post #481

Earlier quoted context omitted.

Cool simple tool! :) I think the reason the source zone might not work (and I'm not an expert, and date times in code are hard), is that all "timestamps" are in Zulu / GMT0 time, so it won't make sense if you try to source a Zulu time from like Hawaii time or whatever.

That was a good guess! Your comment provided some helpful motivation to go look into it. :) It seems to have actually been a typo-misuse of moment.tz's very similar but very different constructor patterns. To illustrate, imagine we have a date "2020-01-01", an offset tz "America/Vancouver", and "America/Toronto" as the locale's timezone. moment(date).tz(offset) says "interpret date in its given tz, falling back to th…

Awesome!

Re: Ask HN: What are some tools / libraries you built yourself?

#487
Lately I wrote a small ssh client that allows you to take your configuration files (such as .bashrc, .vimrc) to the remote easily. Got too frustrated copying those manually as I have quite many remotes I work with and also because I like to tune my configs constantly. Also I have some ideas for further development once I have time for that.

https://github.com/drodil/envssh

Re: Ask HN: What are some tools / libraries you built yourself?

#488
I built a little browser extension to map your Wikipedia journeys.

https://github.com/anirudhvarma12/rabbit-hole-webext/

Unfortunately, I haven't been able to get it to work on Mobile which is where a lot of my own random browsing happens, but I have been told its useful!

Re: Ask HN: What are some tools / libraries you built yourself?

#489
10 years ago I built a little library / test app to support embedded Ruby development with a kind of Fuzx testing. One of the cool features of Ruby is that one thread can raise an exception in another thread.

So my library simply allows you to define a set of exceptions, with a distribution across them. The app runs an extra thread in parallel with the main app, and "carpet bombs" the main app with exceptions drawn from the desired distribution.

Very useful for checking that the code is resilient to all sorts of real world edge cases you haven't thought of!

Re: Ask HN: What are some tools / libraries you built yourself?

#490
Here are some very small tools I made for things I do over and over again…

A button to create new files inside macOS Finder (`touch` without the terminal).

https://github.com/ivanmaeder/finder-touch/

(⌘ + Shift + N creates new folders by the way.)

This I just published now, I use it multiple times a day: an iOS shortcut for emailing myself things.

https://redchamp.net/blog/email-me

A command-line script for bulk-renaming files (it lets you edit file/dir names inside a text editor).

https://github.com/ivanmaeder/vimv/

Post reply on HN