Key of the Key

Recently I've worked a little with GPG keys in a web application (mostly to digitally sign documents, with PIN-protected keys). Two considerations: OpenPGP.js is really cool and easy to use, get it a look to avoid depending from native PHP extentions I've used this composer installable library, which is unfortunately mostly undocumented An hint for future explorers: to retrieve the key ID of a given public key, use this function (built mining for references in GitHub): /* $pubkey is meant to be the contents of the armored file */ function get_…

Keep reading

import, require and include hate for JS

Preamble: next time I will read words like "easy" or "simple" in a Javascript package manager presentation page, I will look for the maintainer's home address and will dump a full load of shit in front of his door. Recently, I started to adopt Laravel Mix to build assets included in my works. Given that collecting a bunch of JS files into a folder and handling them with Minify is way easier, after a few weeks I still insist in this onanist exercise. Today I've learned a fundamental lesson, to…

Keep reading

Update my Models

Today I've discovered a particular behaviour of Laravel models' events handling: the updating event is not fired if the object's attribute have not been really modified. More specifically, if isDirty() returns FALSE. So, your Model::updating() callback is not really executed for each save() on an existing model, but only when something changed. This is probably desiderable in most cases (no extra events fired when not required), but not always. In my particular situation, this behaviour collided with a Model::saved() callback expecting some job to be always done by…

Keep reading

Monthly Report: February 2018

What I've done this month... My Software Projects GASdotto: management application for ethical purchasing groups many fixes on the repository closed #21, #30, #31 given a lightning talk to FOSDEM 2018 Spunta: a simple checklists manager initial release on the repository Burnia: honeypot-based captcha initial release on the repository public instance, freely accessible My Contents 36 CC-BY photos loaded on my Flickr profile. Support my activities with PayPal or Patreon!…

Keep reading

Monthly Report: January 2018

What I've done this month... My Software Projects GASdotto: management application for ethical purchasing groups many fixes on the repository added support for international localization My Contents 95 CC-BY photos loaded on my Flickr profile.…

Keep reading

Monthly Report: December 2017

What I've done this month... My Software Projects GASdotto: management application for ethical purchasing groups many fixes on the repository postegg: endpoint to POST data from web forms some fix on the repository tiret: a simple S3 frontend some fix on the repository…

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

Falling in a Dot

After many hours debugging a Laravel application, I've found the issue. The Request object handles input arrays using a so called "dot notation", to permit you to directly access structured informations in the form of $name = $request->input('products.0.name'); That's really cool. Until you don't give a fuck to arrays direct access, but indeed you need variables containing a dot in the name in your POSTed data. Those will be silently replaced with underscores, and you will spend a whole evening trying to give a sense to…

Keep reading

Monthly Report: November 2017

What I've done this month... My Software Projects GASdotto: management application for ethical purchasing groups many fixes on the repository fixed 16, 22, 23 postegg: endpoint to POST data from web forms initial release on the repository public instance, freely accessible apress: a simple Twitter scheduler fixed 2, 3, 4 laravel-log2rss: Laravel logs published in RSS initial release on the repository Composer package…

Keep reading

Get Informed by Troubles

Today I opened the logs of a Laravel application of mine, publicly available. And found lots of exceptions. Quickly, I realized those were generated by a new user trying to do stuffs no one ever tried (and no one ever noticed as failing). Once the issues were fixed, I decided that the problem had to be resolved: how to stay informed about errors of my applications, avoiding the boring routine of counsulting logs every day? Reading logs is sysadmin's job, I'm a developer, my job is to be lazy... So,…

Keep reading