29 de diciembre de 2014

Automatically store git hash inside C source

Sometimes we need to know what exact revision is a software. This doesn't work

#define VERSION 1.2

Just because it won't be updated by anyone.

On the other hand if using git, we could insert part of the revision hash automatically
  • With a batch file
  • Running the batch file from makefile in every build to avoid any manual task
Here is how

Edit makefile to insert code in build-pre section


Create the batch file version.bat to generate version.h with the hash constant inside



The automatic generated file will be something like this

#define VERSION "877bd1"

Wherever we need to use this version hash, this file must be included

#include "version.h"

Important

Add version.h to .gitignore to avoid modifying hash while build

Final Note

The git sha-1 hash will only acknowledge for changes in current project, if the code depends on other, the proper sha-1 code must be included (or a combination).

Reference and related info
This stackoverflow question

12 de diciembre de 2014

Wey

<sarcastic>

Hice una página Web maestre, más que Web, es Wey. Se puede ver a cualquier hora and lugar, te libera de dependencias antiguas de recursos, espacio y tiempo, cosa de antepasados yeah, somos el futuro man, ve mis anteojos.

Instalé DNS en Argentina, server in USA, una combinación barata, alquilé un full pack que incluye Content Manager ahorra el tiempo, no tengo que instalar ni saber nada, las imágenes fueron a parar a un CDN (Content Delivery Network) servidores distribuidos, copias ready men, para que carguen más rápido, la página trae novedosas librerías en JavaScript, .js, frameworks que la surfean, son fireworks, te los carga directamente desde github.com, todo open chaval, ahí colgué también videos de youtube , links a wikipedia y unas twitts, ¿que cómo hice? relaaajate maese, código embebido, copy+pasta, los agrega en formato cool con sus fechas, all ok Jason.

Monetizo con AdSense, publicidades de google al costado, a la carta. ¿Si podés hacer comentarios? évidemment!, hosteados por Disqus te maneja todo el tema. Podés compartir todo, tira links para share de pinterest, instagram and so on, whatever uncle.

Podes descargarte my App también, desde Google Play, con el usuario mismo de facebook, tres click y te sincroniza todo, va que va. -Interconexión gurú man- ¿Si este post tiene de esos vicios? claro zen, va que va, es la autoreferencia tigre! Tú, chaval, turbina, gatún, ratatuil, que no entiendes, we la people de la internet descubrimos el world, logramos independencia totale, anotá en la historia, esto ladies and gentleman, son decisiones objetivas, libres, es captar la onda pana, sheer efectivity.

</sarcastic>

Consejos para usted que también es cool

  • Al independizarse, vea si no termina en una dependencia más extrema que la inicial.
  • Al batallar contra energía y espacio-tiempo, tenga en cuenta : el juez es el tiempo.

3 de diciembre de 2014

Are you a robot?

reCAPTCHA demo: Simple page

You may be wondering, how can this possibly work ?
Here is my guess: it doesn't.

Source
No CAPTCHA reCAPTCHA