Blog Posts
Introducing HAM v1.0.4.
HAM is a simple Jekyll framework that allows you to build static wiki sites. And today, we are introducing a maintenance update with the following changes. First, the Bootstrap Icons dependency was updated from v1.11.1 to v1.11.3. There are no significant changes from the 100+ new icons introduced since v1.10. These icons are directly built into HAM, and you can simply use them in your Markdown source files as <i> HTML tags. (Just make sure you have reviewed their Web Accessibility recommendations on placing icons.) Next, we have also fixed a bug on v1.0.0 where users are redirected to the wrong YouTube URL when their web browsers do not support <iframe>. Well now, all modern web browsers supports that feature, and we're making this change to ensure that . HAM is not going anyway sooner. We still love HAM, and still use them on some of our internal projects. In fact, HAM still looks very nice on building another API documentation website like this: Of course, there are still some work to do. At least, readjusting the heading texts and adding more Liquid tags, and making these ugly tables more beautiful just what we recently did on our main website. So don't worry, we're still dogfooding HAM on our own.
Site Update: More glass-cards!
Berdoalah untuk saya…
Semenjak saya terakhir kali menulis tentang serentetan masalah aplikasi pemerintah, dan ambisi pemerintah yang ingin menjadi Gojek, saya memutuskan untuk diam berbulan-bulan. Sejujurnya, saya bisa saja melanjutkan serial postingan tersebut, karena hari demi hari ada hal-hal rahasia yang sudah mencuat kepada publik. Tak sedikit juga asumsi saya tentang aplikasi pemerintah terbukti benar. Karena sesuai hikmat Tekotok, di negeri kotok ini siapa yang mengkritik aplikasi pemerintah BAKAL DIANGKAT JADI DUTA APLIKASI PEMERINTAH!!!!!! Tapi keterlibatan saya dalam aplikasi pemerintah yang berikutnya ini justru membuat saya cukup sadar betapa salah arahnya pemerintah dalam berbagai hal. Ada yang baru saja menunjukkan RUU kepada saya bahwa Komisi Penyiaran Indonesia ingin mengawasi situs apapun yang menggunakan fitur live streaming (padahal kasus seperti ini seharusnya lebih cocok dalam pengawasan iklan video), konspirasi pemblokiran situs Bit.ly, pemblokiran layanan Statically (salah satu produk dari rekan sebangsa saya) dan sebagainya. Saya sudah lama jauh dari komunitas Rizky Salminen dan rekan-rekan, termasuk yang mengkritik pemerintah secara bertubi-tubi, dan yang memblokir saya di Twitter karena membuktikan meme “L+Ratio” telah terekam sejak era kitab Daniel pasal 5. Apapun itu, saya ingin mengirimkan pesan yang satu ini: [26] Saudara-saudara! Coba ingat bagaimana keadaanmu pada waktu Allah memanggil kalian. Cuma sedikit saja dari antaramu yang bijaksana, atau berkuasa, atau berkedudukan tinggi menurut pandangan manusia. [27] Sebab memang Allah sengaja memilih yang dianggap bodoh oleh dunia ini, supaya orang-orang pandai menjadi malu. Dan Allah memilih juga yang dianggap lemah oleh dunia ini, supaya orang-orang yang gagah perkasa menjadi malu. [28] Allah memilih yang dianggap rendah, hina, dan malah yang dianggap tidak berarti oleh dunia ini, supaya Allah menghancurkan yang dianggap penting oleh dunia. [29] Dengan demikian tidak seorang pun dapat menyombongkan diri di hadapan Allah. 1 Korintus 1:26-29 BIMK Saya bukanlah Menteri Komunikasi dan Informatika yang sering anda hujat, namun orang-orang seperti saya- (dan juga Anda) -lah yang justru menjadi solusi bangsa, apalagi jika bangsa itu sangat bergantung kepada “Ketuhanan Yang Maha Esa”. Dan melihat tren kebobrokan pejabat-pejabat pemerintah dalam 2 tahun terakhir, kepercayaan saya semakin kuat terhadap Daniel 5, yang membuat saya diblokir seseorang di Twitter. Kalau Anda benar-benar percaya bahwa Tuhan-lah yang memegang segala kuasa, Anda juga harus percaya bahwa Tuhan sanggup menghancurkan mereka yang korup, dan Tuhan akan menaikkan orang-orang yang tak layak secara hukum untuk memalukan mereka semua yang di atas. Mereka yang berpesta pora, dan yang memperalat Tuhan dan agama, semuanya akan ditangkap dan dihancurkan oleh Tuhan. Mene, Mene, Tekel, Ufarsin.
Our guide to our unwritten REST API conventions.
An updated version of this may be available on our digital garden. Naming things is a difficult thing, according to many developers. But not for someone who graduated in an university that’s silently houses great REST API experts. I’m not joking. According to HackerRank in 2021, BINUS University entered the top charts for Asia-Pacific universities (outside of India) according to their technical skills. And how did the university became the top 2 in REST API design, right after Rajshashi University of Engineering and Technology? Source: HackerRank, 2021. 1. Use semantic REST naming scheme. I know, there’s no such a standard term for “semantic REST API” like how it did with HTML, but there’s also a reason why HTTP requests are divided into GET and POST, which then added by PUT, PATCH, DELETE, OPTIONS, and others. We commonly use nested model-centric path approach, where the REST endpoint paths should be named after the model. No, we don’t mean GET /api/get-embed-from-post, but as straightforward as GET /api/posts/embed. Using the /posts/ prefix signifies the endpoint belong to the posts model. The model name must be referenced in their plural form. We first encountered this model-centric approach in Laravel, where controllers (as in the Model-View-Controller / MVC structure) are mapped into an opinionated set of REST request verbs (e.g. GET, POST) and paths. Taking from Laravel’s own example, we decided to define a similar schema: VerbURIDescriptionGET/photosGet an index listing of photos. Get (all) current photos. Can also be potentially used to search for photos.POST/photosSubmit a new photo.GET/photos/{id}Show a specific photo by its (internal) ID.PUT/PATCH/photos/{id}Update the photo information.DELETE/photos/{id}Delete the photo. You may also notice that some endpoints are not listed here. They are commonly used to display the front-end instead of doing the back-end logic. For example, GET /photos/{id}/edit does not edit the actual photo. It only shows a webform to the user, whereas the PUT/PATCH /photos/{id} one does the actual logic. Note: There are some obscure HTTP request verbs listed in https://www.w3.org/Protocols/HTTP/Methods.html that we don’t use, such as CHECKIN, LINK, and TEXTSEARCH. These are rarely recognized in HTTP request and server libraries, so they may just add an additional burden for us and others to implement. 2. Use kebab-case for paths, snake_case for parameters. Another common practice that we used here is to use kebab-case for REST paths and snake_case for parameters, even though that those are defined in the JSON format (which commonly written in camelCase instead). Yes, we do represent data model types (i.e. the kind of data being represented in objects, structs, and database tables) in PascalCase, but when it became part of the REST request, we use the former ones. You can learn more about the differences between these four naming conventions in the FreeCodeCamp. The reason why we used such conventions is to tolerate case-sensitivity, so user do not have to use certain uppercase letters to refer to the right data model. Additionally, web services conventionally used the snake_case for request parameters, so we leave the convention as-is for compatibility purposes. 3. Every response data should correspond closely to the enquired model. Well, we said we’re grouping things based on its model, right? So there has to be a standard way to represent the model and its items for each model-related responses. And that’s what we actually did: always map every model across database, source codes, and input/output serialization. In database, this means the table columns. In the source code, this is most likely to be objects (as in OOP) or structs as a fallback. In data serialization, we can use common serialization objects including JSON and YAML. We still do prefer JSON for REST API responses. For example, creating a new item under the model should give a HTTP response containing the new model, instead of simply signalling that “the insertion is complete” or just the item IDs. Similarly, when updating an item or two, the response should include the updated model items. There might be some exceptions for this, such as when doing batch processing, we could reduce the unnecessary response data load by signifying the updated item IDs, including which one were unchanged or faulty. In his own thesis, Reinhart listed his data type mapping across MySQL, MariaDB, Dart, PHP to ensure that the app’s entity models are properly represented from the database to the backend and frontend. 4. Our standard REST response. { "status": "OK", "data": /* ... */ "warning": /* ... */ } { "status": "KO", "error": /* ... */ "data": /* ... */ } Our standard response is always written in JSON unless a different format is required, e.g. returning an Atom/RSS feed in XML. This response is heavily inspired by the simplistic DuckDNS API and other REST API designs. We commonly fill in the error parameter with error codes, which may vary from system to system. Some of the common ones include {{MODEL}}_NOT_FOUND accompanied with the HTTP 404 status code and perhaps some additional diagnostic data located under the data paraeter. But some systems which require further debugging may return the error message as-is from the related software libraries on that error parameter. 5. Do not afraid of using HTTP response codes. HTTP 200 { "statusCode": 404, "data": "Blog Post not found." } The enterprise developer who made this should go to the hell! Source: https://twitter.com/goenning/status/1782330200958615637 Don’t worry, angry developers. We are still using HTTP status codes responsibly! 6. Now, what if we really need an endpoint that does not really fit into the above conventions? We have an internal term for it: import/export endpoints. They are endpoints which processes a standard model representation from or to the non-standard ones, such as importing items from CSV, or outputting a list of posts in Atom/RSS format. These endpoints do not follow some of our path conventions, but still need to contained inside a model path, such as /posts/feed and /products/import. The expected input and output data formats can deviate from the standard ones, too. Some of our systems also have to deal with other REST API standards, such as utilizing the /.well-known/ path for things related to digital identity and website verification. Many also respect the classic /ping endpoint, which expects to return a plaintext response of pong, to check whether the server is still active. And lastly, we also have a dedicated endpoint group, name /test. Since our model names are plural, we do not really care if the name conflicts with the model Test, since the model will eventually be represented as /tests/. These endpoints are meant for utilities to help developers integrate to our systems, such as /test/access-token to check whether an access token is still valid, and /v4/test/ping (alongside /ping) to check whether the service supports the REST API Version 4 schema.
GitHub: My robots are 2.5x as productive as I am.
Celebrating 10 years of not even finishing my personal website.
Techbros.
Techbros are, for obvious reasons, not just all about iSheeps vs Samsung fanboys anymore. For example, a “cryptocurrency techbro” aka. “cryptobro” is enlightened with the advances of one or specific cryptocurrencies to the point that they forgot that the word “crypto” actually stands for “cryptography”. It’s a whole community of people enlightened with a specific technology that they mostly don’t own, as if they “owned” the technology, who also tries to enforce everyone else to use the same technology. Let’s start with, someone known to actually make large cash selling Notion templates made a poll whether people prefer to use Google Workspace over a bunch of niche tools that he personally use. We can partly see his intentions to offer alternatives to the “boring” Google set of productivity apps. Source: https://twitter.com/gf_256/status/1761471295613534664 The answer is somehow obvious: 65% of voters actually choose A over B. Considering the number of votes, this is embarrasing for the Arc-Superhuman-Notion community out there. Source: https://twitter.com/heyeaslo/status/1760655706733367356 The moral of the story? Has any self-proclaimed “techbro” done useful things to the outside community in the long term? 1. Techbros don't innovate at all. Yes, they're rapidly sharing tech innovations, but they're still don't innovate at all. Taking the case of AI, 99.99% (pun intended) of them don’t actually learn how to make one, the foundations of automata, maths, data collections, some legal policies, and so on. But 99.99% (also pun intended) of them are pledging to use them for a lifetime. The same also goes with the ones who praised Apple’s M1 chips. Yes, M1 is another innovation, but the only innovation these can actually give is to type these, 🤯🤯🤯 emojis over Twitter and now other platforms, too. /* Hey, at least 🤯 is now innovating against 🤣, 😭, and 💩, right? */ A dedicated Notion influencer like the above case proved to rake in as large as $239,000 selling Notion templates over Gumroad. But what happens if Notion ended their product? Sure, we have some alternatives including AppFlowy, but it’s important that many of these will less likely to incorporate all the things that made Notion, Notion. That’s why Google Sheets didn’t have the exact same set of supported functions compared to Microsoft Excel. Or Zoom having the same collaboration capabilities with Google Meet. But will Easlo continue to succeed in a post-Notion world? A quick LinkedIn search around the founder and the company clearly shows this guy’s first and only listed professional work experience is building Notion templates since the start of his career. No experience over Google, Unilever, KPMG, or others? Oh, no! I thought this company was founded while the founder was struggling inside the common office routine in Unilever, for example, to build the “second brain” on top of Notion.The gap between 2020 and 2023 could be his college years. So, at a glance, it might be the person who truly innovates in building templates and “second brains” for people. But is it? Isn’t that the original creators of the templates feature in Notion who actually innovate in productivity? 2. Many techbros today don’t bring any real, usable values to the community. They’re just selfish to make people do or buy what they want. “Hey, I recently convinced an entire village in South Africa to open up payments in #Bitcoin. One small step to open the global economy freedom to the country!” Yeah, that sounds good, especially if you’re the one introducing it to them before moving to Portugal then Japan and Australia as a digital nomad. But have you ever consider what would happen to them if they forgot their recovery phrase, or even worse, forgot what does these 32 English words you told them to write on paper and save it securely actually mean to them! Oh, no! There’s no such things as “forgot private key” in Web3 just like “forgot password” in Web 2.0! They will lose their access to the global economy as you envisioned! Have… anyone consider certain people who did these things as selfish? Because most techbros have the same ultimate goal: making more and more people to adopt the same and specific technology as they loved, endorsed, and enforced. 3. Techbros believe they are part of marketing. Actually, they're the target market. Source: https://twitter.com/SuperRabbitTank/status/1659559360370991111 This sounds like a win-win solution, though. They dedicate their lives for and only for consuming all the innovations the tech world is producing, and for companies who made, this is profitable. And this makes techbros no different than social clubs that commonly endorse certain luxury bags, clothes, or cars. Nothing’s different here, even the goal behind these clubs are also the same: Endorsing people to use certain brands, right? But at the same time, these cool social clubs also become the coolest preys of luxury brands. Whenever Louis Vuitton or Ferrari release a new product, it’s significantly easier for them to trick and target social clubs to buy more. So are techbros in the eye of OpenAI and many other tech companies today.