RSSAmplifier

Blog

Julio Capote's Blog - Feed

capotej.comRSS feed ↗20 posts

Latest posts

The first thing I've been adding to AGENTS.md

My projects these days will usually begin with an AGENTS.md file where I'll define the stack of linters and context required for an agent to successfully stumble onto a working solution (most of the time, anyway). But lately, I've been starting with just the following snippet: ## RFCs Significant changes, architectural decisions, and new features should be proposed as RFCs in the `rfcs/`…

Running an aarch64 Fedora VM on MacOS using QEMU 10

"Works on my machine" The following configuration works on my 2021 M1 Max laptop running MacOS Sequoia 15.6.1. ARM Architecture Most of the guides I found were focused on emulating amd64 / x86-64 architectures. This guide instead targets the aarch64 / arm64 architecture (same as the host system) to minimize emulation overhead. Steps These steps should get you a Fedora Server VM that you can SSH…

Tmux Session Coloring

Recently, I've really gotten into tmux for managing all my terminal sessions/windows. Not so much for the panes, but more for keeping a highly contextual environment per project or task. As the number of sessions grew, they became difficult to tell apart. For a few days now, I've had the idea of hashing the name of the session into a unique color, so that every session had its own status-bg color.…

Golang HTTP Handlers as Middleware

Most modern web stacks allow the "filtering" of requests via stackable/composable middleware, allowing you to cleanly separate cross-cutting concerns from your web application. This weekend I needed to hook into go's http.FileServer and was pleasantly surprised how easy it was to do. Let's start with a basic file server for /tmp : go main.go func main() { http.ListenAndServe(":8080",…

Playing with groupcache

This week, @bradfitz (of memcached fame) released groupcache at OSCON 2013. I'm already a big fan of memcached and camlistore , so I couldn't wait to download it and kick the tires. By the way, I strongly recommend you go through the slides and README before going further. What groupcache is not After downloading it (without reading the slides ), I instinctively searched around for how to actually…

Automatic High Quality Releases

Recently, I invested some time into automating some of the work that goes into a Finatra release. The work consists of updating: The version in the XML fragment of the main README.markdown The version in the pom.xml of the example app Any API changes in the example app The version in the template pom.xml of the app generator The generated unit test of the app generator that demonstrates testing…

Announcing Finatra 1.0.0

After months of work Finatra 1.0.0 is finally available! Finatra is a scala web framework inspired by Sinatra built on top of Finagle . The API The API looks like what you'd expect, here's a simple endpoint that uses route parameters: get ( "/user/:username" ) { request => val username = request . routeParams . getOrElse ( "username" , "default_user" ) render . plain ( "hello " + username ).…

Base: A Scala Project Generator

Finally got tired of copy pasting other projects and gutting them to make new ones, so I created base , a shell command that creates new scala projects. Creating the project: $ base new com.capotej.newproj creating project: newproj creating App.scala creating AppSpec.scala creating pom.xml creating .gitignore creating .travis.yml creating LICENSE creating README.markdown Done! run mvn scala:run to…

Riak at Posterous

A few months ago, I gave a presentation on how Posterous uses Riak for it's post cache; At #ricon2012 I ended up retelling this story to numerous people, so I thought I'd post the slides and video here.

An Embedded Key/Value Store for Shell Scripts

UPDATE: this is now available as a sub command, here: kiev Cooked this up last night when I needed a simple key/value store for use in a shell script: #!/bin/sh DBFILE = example.db put (){ echo "export kv_ $1 = $2 " >> $DBFILE } del (){ echo "unset kv_ $1 " >> $DBFILE } get (){ source $DBFILE eval r = \$ $( echo "kv_ $1 " ) echo $r } list (){ source $DBFILE for i in $( env | grep "kv_" | cut -d =…

Finagle with scala-bootstrapper

I've been fascinated by the concepts in finagle for some time, but being a scala noob, I never knew how to bootstrap a finagle project. Turns out twitter has a gem, scala-bootstrapper , that generates a simple thirft based key/value store for you. There's even a tutorial on how to extend the example project into a distributed search service. This is a guide on setting it all up locally, it assumes…

Render image links directly inside Adium

Last night I delightfully discovered that Adium Message Styles are just html, css, and javascript rendered inside a webview. The next natural step was to write something in it, so I wrote a Message Style that tries to render any image link directly inline the conversation (campfire style). The code was written at midnight after a long day, so its not best. Basically, it's a setInterval that runs…

MigrationFor: Write migrations right from the command line!

As someone who mostly stays in the rails console, I’ve always hated forgetting a field, creating a migration, finding it among your other 500 migration files, then adding the one line you need to add, then running it. This is probably the most annoying part of the Rails experience. I’ve always wanted to write a better migration generator that could take a list of commands/fields and write the…

What I released in 2010

Here’s a recap of what I’ve worked on and released in 2010: Youtube Fraiche I couldn’t find a youtube downloader that worked on github, so I wrote my own one evening Uploadd and paperclip_uploadd I wanted to upload and store images off-site (using paperclip/rails) on an server which has cheaper bandwidth rates than S3. Using rainbows, this tiny rack script has handled over a 1.5 million uploads at…

Using Rack applications inside GWT Hosted mode

This guide will show you how you can use JRuby to run any Rack application inside Google Web Toolkit’s (GWT) hosted mode server so your interface and your backend are of the Same Origin. BackgroundGWT has two ways of interacting with a server: GWT Remote Procedure Call (RPC) and plain HTTP (XHR). GWT-RPC is a high level library designed for interacting with server-side Java code. GWT-RPC…

Useful Rails Routing tips

Even though I have been using Rails for fun and profit for about 2 years now, I felt I never really used it’s routing engine to its full potential. So I checked out new Rails Routing from the outside in guide and discovered bunch of useful tricks that I (and maybe you) had no idea you could do. Here they are: Multiple resource definitions on a single line map . resources :photos , :books , :videos…

So you want to click that button?

I stumbled upon http://clickthatbutton.com during my routine lurking of hacker news . After being amused for about 10 seconds, I decided to take it to the next level; I wanted to click on it really, really fast. After going through a few solutions (simple js while loop in firebug, then curl/wget) and failing, the idea of using selenium popped into my head. So I went off to their site and installed…

Arrow key navigation for text fields

Here is a class for enabling the use of arrow keys to navigate through a grid of input fields: (using mootools) var FocusMover = new Class ({ initialize : function ( sel , col_num ){ this . sel = sel this . col_num = col_num this . inputs = $ $ ( this . sel ) this . current_focus = 0 var self = this this . inputs . each ( function ( item , index ){ item . addEvent ( ' keydown ' , function ( key ){…

Tabbing through fields vertically

Sometimes it’s useful to switch the browser’s default tabbing behavior (left to right) to the opposite (top to bottom) when your input fields are in a grid layout instead the of the usual single column layout. Having to do this manually is a real pain, especially for large grids; So here is a solution in javascript, using mootools: window . addEvent ( ' domready ' , function (){ var trs = $ $ ( '…

Why MooTools (or Why not JQuery)

I’ve been toying around with MooTools a bit lately, and I’ve found the experience quite enjoyable and refreshing. Naturally, I twittered about it and went along my merry way. Moments later (and much to my surprise), I had a direct message from John Resig himself asking “Why, what’s wrong with jQuery?”. I was pretty taken aback that he would take time from his surely busy day to message a total…