Check the Checkbox

I often use the "add and remove rows from a grid" pattern to permit handling groups of data, but today I had to manage a particular use case. Given a simple table <table> <tr> <td> <input type="text" name="firstname[]"> </td> <td> <input type="text" name="lastname[]"> </td> <td> <input type="email" name="email[]"> </td> </tr> <tr> <td> <input type="text"…

Keep reading

Map Drop

I wanted to recreate the Flickr's feature to drop photos on a map to geolocalize them. Like this: So, hacking on a MapBox canvas, I obtained that: Here we have a <div id="map"> used to instance the MapBox map many <div class="thumb">, each containing the img to geolocalize a few CSS and JS The important part of CSS is the "overlay modal" effect generated around the dragged image when over the map, obtained with a little padding, a blank background, and the evergreen trick…

Keep reading

SAMLStorm

SandStorm is a cool solution to host simple web services and let users use them easily. It can be installed with a few commands, but still has an issue that bothered me: it is not possible to have a publicly accessible instance, as all of the involved login methods imply some kind of explicit authorization or explicit invitation from the administrator. The only viable way I've found to publish a public SandStorm instance has been to setup a SAML Identity Provider, implement there new users' registration flow, and activate that…

Keep reading

Mails into the Web

Requirement: "Given this Mailchimp newsletter, embed the latest issue in that Jekyll static website". Mailchimp offers many APIs, but this approach requires too many complications. Instead my solution relies on RSS: given the RSS feed of your newsletter (you can obtain it with the "RSS" link on the top-right corner while visualizing an issue on the Mailchimp website) you can retrieve the full HTML of the latest campaigns and embed it directly. First problem: Mailchimp doesn't have CORS headers. So you have to use a proxy. Second problem: the HTML…

Keep reading

More Work Surface

I usually work on a laptop with an external monitor, but given the abundance of monitors at home I've looked around for some way to use a RaspberryPI as "wireless video interface" and further extend my display real estate. I've not been able to find any method, but I've found I'm not the only one with the same idea. Many suggest to adopt Synergy to switch seemlessy across the desktops, but... Oops, Synergy no longer works with Wayland. Investigating a little been more, I've found a little gem called x2vnc.…

Keep reading

Reuse: Sounds Good

I like to listen at streaming radios all day long while working and hacking, but I was annoyed by plugging and unplugging the speakers' audio jack from my laptop every time I have to move it. Some time ago I attached speakers to a RaspberryPI, so to obtain an isolated system to play music, but it was inconvenient to interact with it by a SSH connection and I always procrastinated the effort to give RuneAudio a try. Today, inspired by this post on Slashdot, I remembered to have still around…

Keep reading

Hard Style Sleeping - Lazy Edition

More than one year ago I managed to put a RaspberryPI and a pair of speaker on my bedside table, programmed to loudly play a dubstep music stream at a given hour to wake me up on the most brutal and effective way. It worked, but recently I had to setup different hours on different days and it was boring to daily change the configuration of the application. So I tried to introduce a more complex configuration on my little software, breaking everything. I'm too lazy to fix it, so…

Keep reading

DNS, The Masquerade

Scenario: a RaspberryPI primarily acting as access point, assigning IPs by DHCP and catching all DNS requests to redirect all HTTP traffic to himself, which may eventually switch to connect as a client to an existing wireless network (and delegating DHCP and DNS to another access point). 90% of this stuff may be easily achieved with nmcli, the powerful and convenient command line interface for Network Manager. nmcli c add type wifi ifname wifi-device con-name myconnection \ autoconnect yes ssid myconnection nmcli connection modify myconnection \ 802-11-wireless.mode ap 802-11-wireless.band bg…

Keep reading

Signed in Blood

As I'm now a business holder under the Italian laws jurisdiction, I had to ask a legally recognized "digital sign": a USB key containing some spare applications, libraries and a set of public and private certificates to produce recognizable digital signs identifing myself. The certificates are in an unknown and very specific codification, so the embedded applications are required to actually use them: a classic RSA key pair GPG-style would have been to easy... Today I've been to the local "Chamber of Commerce" to obtain my personal USB key, as…

Keep reading

Lazy Developer Portfolio

I'm a professional freelancer, and it is useful to highlight my activities for self-promotion. Most of my peers have some kind of online portfolio listing previous works and personal projects, and so I do on my website. But I'm also a lazy developer, and often I forget to keep it up-to-dated and meaningful. So, I've just deployed a little script to do it for me. You can find the code here. The concept is: all items are listed in a sources.json file, with informations about the repository where the…

Keep reading