HNHacker News
TopNewBestAskShowJobs

emadda

341 karma · joined November 27, 2019

https://enzom.dev
submissionscomments
emadda··on Airbnb Is Different Now
https://stay100.app is a AirBnB search engine designed for desktop screen sizes that I created.

Give it a whirl.

emadda··on How to build a IP geolocation database from scratch?
Does anyone know how accurate Cloudflare geolocation is (for workers requests)?
emadda··on Johnny Decimal: A System to Organize Projects (2015)
I didn’t like the numbers to begin with, but there are a few advantages:

- After a while you associate the number with the subject so it becomes faster to visually scan a list.

- You can type the number faster. They are shorter to reference.

emadda··on Beetle grows ‘termite’ on back to steal food
I wonder if it is possible an animal can edit its own DNA based on things it observed with its senses in the environment.

Eg Beetle observes kin dying via termite melee, encodes a potential solution in the DNA for the next generation.

emadda··on Internals of async / await in JavaScript
A nice use of async generators is when you have an API with paginated results.

The generator function keeps track of the current page.

This allows you to use a `for await` loop which is quite concise.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

You can do it without generator functions, but generator functions allows the caller to not have to know about the underlying pagination API.

emadda··on Why Htmx Does Not Have a Build Step
I often use vanilla esbuild installed via NPM.

I feel like this build step would still work in 5 to 10 years:

- esbuild is compiled into a single binary for each target system so has minimal dependencies.

- NPM makes the version immutable, and will download the same binary version on ‘npm install’.

- I will use .tsx as my extension but use only pure JS, this gets me IDE suggestions without writing TS types, which works well for small projects.

Compared to webpack, esbuild seems unbreakable.

emadda··on Modern CSV version 2
It looks cool.

What are the benefits over converting the CSV to a SQLite DB and using a DB GUI?

emadda··on Monitoring your logs is mostly a tarpit
I recently released ‘lilo’, a CLI that downloads your GCP logs to a SQLite DB.

It works best when you are logging structured data in the form of JSON lines though, so you can query the JSON structure.

https://github.com/emadda/lilo

emadda··on Comlink Makes WebWorkers Enjoyable
I'm not sure to be honest, https://caniuse.com/indexeddb lists >95% for browser implementations.

I quite like IndexedDB as it is widely supported by browsers.

Although for simple data I prefer the sync localStorage API.

emadda··on Comlink Makes WebWorkers Enjoyable
One alternative to Comlink is to use IndexedDB transactions and polling.

IndexedDB can be shared amongst Web Workers for the same origin (localStorage cannot).

https://dexie.org is a nice IndexedDB library.

As an example, if you have many web workers, each can write their current state or use transactions to take items from a queue, and a central UI can just query the single IndexedDB.

emadda··on Show HN: Local development with .local domains and HTTPS
Looks very nice.

Side note: I released https://tabserve.dev a few months ago.

It uses a browser tab and web workers as a reverse proxy to get a https url to localhost.

emadda··on Tell HN: Airbnb’s transparent pricing is a lie
Side note:

I released https://stay100.app recently.

It lets you view all stays in a grid with the final price you'll pay.

emadda··on Play deprivation is a major cause of the teen mental health crisis
Play is the Trojan Horse for getting the organism to learn the principles of reality.
emadda··on Easy HTTPS for your private networks
I released tabserve.dev recently.

It gives you a https url for localhost by using your browser as a reverse proxy.

Take a look: https://tabserve.dev

emadda··on It Took Me a Decade to Find the Perfect Personal Website Stack – Ghost+Fathom
Cool, care to share your blog?
emadda··on Ask HN: How did you migrate off Evernote?
macOS, legacy desktop app: You can export each note to a PDF by highlighting them all, print, then save to PDF. The Evernote client will export each one to a PDF in a loop.

I think there are options for adding the note folder to the PDF header too.

This gets you a read only archive that should be readable far into the future without needing a note reading app that understands Evernote’s export XML (just files and PDF).

Apple notes let’s you import Evernote XML too.

emadda··on Deno 1.35: A fast and convenient way to build web servers
I have been using zod to create validation functions. The validation functions give the TS compiler hints about the types that are output after validation.

I think you either:

(1) start with the runtime code and derive the types (what TS does by default).

or (2) start with the types and derive the runtime code (like "macros" in some languages).

Does anyone have any suggestions for the best way to do this in a Node runtime?

emadda··on Rich text editors and rendering engines
An alternative to contenteditable is to use a plain <textarea>, measure the inline width of the rendered text to get the absolute position of each word, and then overlay styles on top.

You need to debounce/throttle the change event handler to not fire too many re renders when typing.

I used this approach for https://bigwav.app for highlighting text.

You can click the demo .bigwav file to take a look.

emadda··on Show HN: Tabserve.dev. HTTPS proxy using Web Workers and a Cloudflare Worker
Thanks, yes it is the same thing.

Tabserve adds a few extras:

- No need to install a CLI, safer as it is in the browser sandbox.

- Use the Chrome dev tools for observing requests.

- Config multiple reverse proxies on different browsers remotely.

- GUI.

The cloudflared tunnel also supports any TCP/UDP traffic, tabserve is just for http.

emadda··on Show HN: Tabserve.dev. HTTPS proxy using Web Workers and a Cloudflare Worker
WebSockets will be added soon.

I think streaming HTTP responses may currently work. The client forwards the response back to the original client chunk by chunk (it does not wait for the entire response). I still have more testing to do.

emadda··on Show HN: Tabserve.dev. HTTPS proxy using Web Workers and a Cloudflare Worker
WebSockets will be added soon.
emadda··on Show HN: Tabserve.dev. HTTPS proxy using Web Workers and a Cloudflare Worker
The client itself is likely to be more secure than other reverse proxy CLI's as it is inside your browser sandbox. CLI's have access to all your files.

You would take the same precautions as putting any other web server on the web - you might want to use a password or a hard to guess subdomain if you do not want others to access it. But I would assume you would be using test data in your dev environment.

The Cloudflare WAF (Web Application Firewall) also blocks requests to your web server. I think that is just DDOS protection.

emadda··on Show HN: Tabserve.dev. HTTPS proxy using Web Workers and a Cloudflare Worker
Thanks.

Yes, `Access-Control-Allow-Origin: app.tabserve.dev` is correct, app.tabserve.dev is the origin where the fetch requests are made to your localhost.

emadda··on TabDB: Using browser tabs as a database like only a maniac would
Related: I recently released https://tabserve.dev which is a reverse proxy using your browser tab.
emadda··on “WebAssembly runtimes will replace container-based runtimes by 2030”
Reasons why WASM will not replace containers:

- System calls call into the Linux kernel for things like disk and network access. These are highly tested and reliable.

To keep WASMs isolation and portability it would need to replace these APIs with new message passing ones which would kill performance.

- C FFI

- Dynamic libs

Being able to integrate with existing C libraries in the way they are intended to be used.

- Better VMs/OS level sandboxing

MicroVMs like Firecracker that let you run your code unmodified as if it is running directly on the OS.

I like WASM, but feel it is over hyped and the alternatives are “good enough” and already widely used.

In the browser it is great though.

emadda··on Can You Change Your Metabolism?
Those categories cannot be “wrong” as they are based on the types of molecules.

I think what you mean is they are not meaningful to guide health decisions as they are too broad and can be further subdivided into more specific categories.

emadda··on Cloudflare Is Having Issues
On a side note, I recently released durafetch.com which allows you to download your Durable Object state to a local SQLite database.

It allows you to observe and query your state in dev and prod.

Take a look: https://durafetch.com

emadda··on Military whistleblower claims US has UFO retrieval program
If a alien UFO can cross the galaxy, why can’t they cruise above the earths surface without crashing?
emadda··on Why SQLite is so great for the edge
I recently released Durafetch.

It consists of server functions to add to your Cloudflare Worker and a CLI to download all Durable Object state to a local SQLite database.

Take a look: https://github.com/emadda/durafetch-server

emadda··on Goodbye, section 2.8 and hello to Cloudflare’s new terms of service
What services do GCP have that are 100x cheaper?

Generally they seem quite expensive. I use GCP, very reliable though.

← PreviousPage 4 of 6Next →