RSSAmplifier

Blog

Gonzalo Andreani

Recent content on Gonzalo Andreani

blog.andreani.inRSS feed ↗38 posts

Latest posts

Almost realtime deploy logs in my SaaS

A totally unnecessary but cool change to my internal tools: realtime deploy lgos in my SaaS. 
 Here’s what it looks like: 
 
 
 


 
 
 Table of Contents 
 
 
 Storage for deploy logs: a sqlite column. 
 The storage approach 
 The presentation 
 Future improvements 
 
 
 
 


 Storage for…

The long list of bad decisions I made for my new SaaS

I’m about to launch a new analytics SaaS. Easily the biggest project I’ve ever taken on myself. I don’t usually finish ANY projects so this is a big life goal for me. 
 I have humble goals for myself: get two subscribers by the end of the year. There’s six months left to the year so if I can average bringing in a third-of-a-person each month I got that goal in the bag.…

Your intuition of LLM token usage might be wrong

I just finished a task with GPT-5.4-mini. Here’s the session summary from oh-my-pi (an agent harness) : 
 Tokens 
 Input : 3_648_340 
 Output : 61_676 
 It was a hefty 30 min session. I (we?) mostly tweaked how Service A loads two sqlite databases. It now loads them per request instead of once when the service starts up. The agent had to investigate multiple services from the…

Locust Load Testing and Markov Chains

I recently read this blog post on the pains of load testing . I want to focus on two pain points pulled right out of the post: 
 
 
 Most load testing tools support simplistic workloads, and even the complex ones don’t let you do everything that’s realistically needed to simulate real usage of a web application. 
 
 
 
 
 Writing the test with a…

I love the old man minimap in VS Code

If you don’t use the minimap in VS code you probably turned it off a while ago (like me). I thought it was small and useless unless your code has a very distinct structure. 
 It’s kinda like sublime’s minimap: 
 
 
 
 But… 
 I was recently perusing the options in VS code and noticed you can change the size of the minimap. There’s 3…

On Resurrecting a 12 year old blog

This used to be an old blog of mine. So much has changed in 12 years. 
 Then and now 
 It used hosted on Github Pages. Now it’s on Cloudflare pages (or is it Cloudflare Workers?) 
 It used to run using jekyll (ruby). Now it’s running on hugo (golang). The first public release of hugo was July 5, 2013 
 It’s not just the tech that changed. My life is totally…

Updating a forked Git repo

A while ago, I forked the ActiveAndroid repository to add some of my own changes to the ORM framework. Today I wanted to use the library again, use the new changes that the original maintainer has implemented, and also use my own changes. It turned out to be easier than I thought, despite there being 112 commits between the original repo and my forked version. Here’s what I did 
 $ git…

ADB access to remote server from local usb

I have a VPS server where I’m compiling CyanogenMod and some android kernels. To compile CyanogenMod we need to pull some vendor specific “prebuilts” i.e. binaries. Connecting the server to the device connected to my laptop is actually quite trivial. 
 First we put adb in TCP/IP mode 
 adb tcpip 8001
 
 Then, let’s forward the that same port to the…

Bug Progress: Day 2

Here’s a small overview of my progress in fixing bug #924609 . 
 Finding the code 
 We know how to replicate the video app’s thumbnail functionality. We just need to find the relevant code that generates (or doesn’t generate, in this case) a thumbnail for an attachment. 
 Here’s the path I took to find the relevant code 
 
 Compose.js - handles the UI…

Building the Emulator

In this post I will talk about my experience with building the Firefox OS emulator. It’s a simple process but the documentation is spread out over a couple of pages in the MDN. 
 Getting the code 
 The Firefox OS project is based on the Android project and is spread out over many Github repositories. The following commands fetch the code from the servers. 
 git clone…

Simple Notes: Edit Notes

In this post, I walk through the implementation of the Edit Note screen pictured below 
 
 
 
 Intuition fails 
 The Edit Note section is very similar to the New Note section. My first instinct was to use the same section for both purposes and modify them in javascript according to which mode we were in. This is the essence of the Don’t Repeat Yourself…

Simple Notes: Hidden Notes Fix

In this post, I will polish up the application and address one of its shortcomings: hidden list items. I did not test the list functionality fully when developing the application. This is what caused the bug to slip under the radar. 
 The Problem 
 The Problem can be summed up as follows. The scrollable section’s height was set to 100%. This means the height will be equal to…

Bug Progress: Day 1

I have volunteered to help fix a bug in Firefox OS. The bug is pretty small. It can be summed up as follows. When you attach a video to the SMS application, it shows a generic icon. Ideally it should show a thumbnail preview. In this post, I will explain my understanding of how the Gaia video application generates a thumbnail from a video. 
 MediaDB 
 MediaDB is the shared library that…

Simple Notes: Date

This is the final day in which I worked on the Simple Notes application. I implemented a due date for each note. &#xA; Selecting a date &#xA; Firefox OS comes with a native date picker optimized for mobile layouts. In order to call forth this date picker, one has to simple add the following input element to a form. &#xA; < input type = 'date' > &#xA; And said Date picker looks like this &#xA;…

Simple Notes: Deleting

The next functionality I decided to implement was the ability to delete multiple notes at once. I originally planned to implement this functionality along with the index section, but there were a lot of little details that I overlooked during the planning phase that set me back. &#xA; Edit Mode &#xA; The user enters the multiple-deletion mode by pressing a button. I used the EditMode BuildingBlock…

Simple Notes: Index

In this post, I will outline the modifications I did to the Simple Notes app in order to create the index screen. &#xA; Sectioning &#xA; The first order of business was separating the Index from the New Note section. I used the same CSS rules from the BuildingBlocks Transitions post. With these rules I could use the following structure to separate the sections. &#xA; < section role = 'region'…

Simple Notes: New Note

Over the next couple of days I will be creating an application that will store notes for the user. I will not spend more than 4 days working on it, so my top priority will be basic functionality and polish/features will follow afterward. &#xA; Today I will tackle the New Note screen, as it seems like the most difficult part of the application. &#xA; Database Structure &#xA; The database model used…

Building Gaia

In this thread I will cover my experience building the Gaia interface from the source code. I followed the Quickstart Guide at MDN. &#xA; &#xA; Note: I used a linux distribution based on Ubuntu Precise (12.04). This is not meant to be a guide, I&rsquo;m just merely documenting my experience. &#xA; &#xA; Getting the Source Code &#xA; The source of the Gaia interface is located at…

IndexedDB Caveat

This post will explain a caveat of the IndexedDB API that I have encountered and my work around. &#xA; The Caveat &#xA; Part 1 of the IndexedDB posts explains that it&rsquo;s possible to store objects using a keyPath and autoIncrement . The documentation states that the key will be stored in object[keyPath] if it doesn&rsquo;t exists already. This is not true. Examine the following code &#xA; //…

WebAPI: IndexedDB Part3

In this post we will wrap up IndexedDB by exploring cursors and indexes. Make sure you read part 1 and part 2 . &#xA; Cursors &#xA; A cursor allows an app to iterate through all the results of a query in a manner that does not block the main UI thread. Opening a cursor is simple, just call openCursor() on an object store. It returns an IDBRequest object. The result of the request will be the…

WebAPI: IndexedDB Part2

In this post, we will cover how to add, get, update, and delete records from IndexedDB . &#xA; Transactions &#xA; All of these operations are done through the respective methods in the object store interface. The only way to access an object store is through transactions. &#xA; IndexedDB is a transactional database, so any changes to the database are passed through a transaction context.…

WebAPI: IndexedDB Part1

In this post, I will introduce IndexedDB . As the name suggests, it is a lightweight database. It&rsquo;s not a relational database however, it&rsquo;s a key-value database. It maps keys to javascript objects (or primitives). The API is a little more difficult to grasp than the other APIs offered by Firefox OS so this post is broken up into two parts. The first part will talk about how to create…

WebAPI: Device Storage

This post will give a short demonstration of the Device Storage API . &#xA; The storage types &#xA; Firefox OS divides the storage into the following storage areas. &#xA; &#xA; apps : This storage area is used to store the user data needed by apps. Only available for certified application only. &#xA; music : This is the storage area where music and sounds are stored. &#xA; pictures : This is the…

Submitting a Firefox OS bug

This post documents my experience submitting a bug report to the Firefox OS project. The bug resides here . Hopefully it&rsquo;s not a duplicate (I searched for a while), and hopefully it will benefit the project in the long run. &#xA; Stumbling on a bug &#xA; I found the bug while messing around with the Contact API . When an application wishes to use the Contact API, the system will present a…

BuildingBlocks: Status

The Contacts part of the API Showcase application does not show a lot of information to the user. All the information is displayed in the console. A good way to remedy is to use the Status building block. &#xA; The Simplest &#xA; This is by far the simplest building blocks to use by virtue of the implementation of the building blocks demo ( download here ). In order to take advantage of this,…

BuildingBlocks: Confirm

This post will show one way to implement the Confirm dialog from the building blocks. We will ask the user confirmation when deleting all contacts. We will be using the Transitions to show and hide the dialog. &#xA; Importing &#xA; Like all BuildingBlocks components, the Confirm dialog must be imported. Download the building blocks sample application , and copy &#xA; &#xA; style/confirm.css &#xA;…

WebAPI: Contact Continued

Last post we explored the Contact API, but ran into permissions problems. This post, we&rsquo;ll show the fix and show the last part of the contacts API. Try the (working) demo and check out the source code . &#xA; Wiping the slate &#xA; The most destructive API call in is by far the clear() command. It will remove all contacts from the device. The system does not step in and warn the user while…

WebAPI: Contact

In this post we will be exploring the Contact API . &#xA; Creating a Contact &#xA; The code to create a contact differs between Firefox OS v1.2 and v1.3 &#xA; var contactData = { &#xA; givenName : [ 'John' ], &#xA; familyName : [ 'Doe' ] &#xA; } &#xA; &#xA; // V1.2&#xA; var person = new mozContact (); &#xA; person . init ( contactData ); &#xA; &#xA; // V1.3&#xA; var person = new mozContact (…

BuildingBlocks: Transitions

On the previous post , we finished implementing a drawer but we didn&rsquo;t have true navigation functionality. The drawer simply changed the button that the user was able to click. In this post, we will use Transitions . &#xA; The Structure &#xA; We will separate our app into three parts. Let&rsquo;s start with the Notification section &#xA; < section id = 'notification' role = 'region'…

BuildingBlocks: Drawer

Building on our previous work , we&rsquo;re going to separate the notification demos, from the alarm demos using the Drawer . Download BuildingBlocks here . &#xA; First Attempt &#xA; According to the documentation, all we need to implement the drawer is to import &#xA; &#xA; headers.css &#xA; the style/headers folder &#xA; drawer.css &#xA; the style/drawer.css folder &#xA; &#xA; Then we can…

BuildingBlocks: Buttons

Before we keep exploring WebAPI, we can take a moment to build a UI foundation our API Showcase app. I previously mentioned Gaia Building Blocks. It&rsquo;s a mini GUI framework for Firefox OS. So far, the application only showcases 2 APIs: Notification and Alarm. Let&rsquo;s examine the Button building block &#xA; Downloading &#xA; You can download Building Blocks here . This is an archive of the…

WebApi: Alarm

This post will cover the Alarm API . Instead of creating a brand new application, we will modifying the API Showcase app. As always, I would encourage you to try the demo . &#xA; Permission &#xA; The Alarm API requires alarms permission. The following is required in the manifest file &#xA; "permissions": {&#xD;&#xA; "alarms": {&#xD;&#xA; "description": "Required to schedule alarms"&#xD;&#xA;…

WebApi: Notification

This article will show how to use the Notification API . We will be building the app API Showcase through the rest of these series to quickly test each new API. Try the demo of version one &#xA; Note: This is the icon for the new application &#xA; &#xD;&#xA; &#xD;&#xA; &#xA; Permission: Manifest &#xA; Unlike the previous post, the Notification API requires requesting a permission. This can be done…

WebAPI: BatteryManager

In this post were going to explore the (small) BatteryManager API . &#xA; BatteryManager is returned by navigator.battery . You can interface with the object in the following ways &#xA; &#xA; level &#xA; chargingTime &#xA; dischargingTime &#xA; &#xA; The battery manager also dispatches the following events &#xA; &#xA; levelchange &#xA; chargingchange &#xA; chargingtimechange &#xA;…

Simple Clock: Images

In this post, we modify the previous app to create an analog clock using images. Try the Demo &#xA; HTML: &#xA; <!DOCTYPE html> &#xA; < html > &#xA; < head > &#xA; < meta charset = 'utf-8' > &#xA; < title > Simple Clock: V2 </ title > &#xA; < script type = 'text/javascript' src = 'js/app.js' > </ script > &#xA; < link rel = 'stylesheet' type = 'text/css' href = 'css/style.css' > &#xA; </ head >…

Simple Clock: Text

In this post, we create a simple clock app. &#xA; HTML: &#xA; <!DOCTYPE html> &#xA; < html > &#xA; < head > &#xA; < title > Welcome to JS Bin </ title > &#xA; </ head > &#xA; < body > &#xA; < h1 id = 'clock' > Time </ h1 > &#xA; </ body > &#xA; </ html > &#xA; We are going to just replace the text inside the H1 with the id clock . &#xA; CSS: &#xA; h1 { &#xA; position : absolute ; &#xA; top : 50 %…

A Quick Intro to Firefox OS for Devs

This post will give an overview of Firefox OS. The audience are developers of mobile applications. &#xA; WebAPI &#xA; The most interesting part of the OS to a developer is the API. The APIs provided by Firefox OS are officially called WebAPI . They control access to the device hardware. The APIs are drafter by Mozilla, implemented in the current version of Firefox OS, and then submitted to the W3C…

Hello, World: Firefox OS Style

This is the first entry to the blog series dedicated to developing mobile applications for Firefox OS . &#xA; Hello, Firefox OS &#xA; Firefox OS apps are created using the standard web technologies: HTML, CSS, and Javascript. Let&rsquo;s create three files that test the basic functionality of each of these technologies. &#xA; HTML: &#xA; <!-- hello.html --> &#xA; < html > &#xA; < head > &#xA;…