rand(Ø)

> beautiful code & photos

about <

Posts tagged: code

MySQL: adding an index on a big-ass table

Okay, I'll admit it: SQL and big data things aren't at the top of my skillset.

No earlier than today, I resolved an issue we had in our customer databases: adding a missing index.
Seems easy at first but if the table is HUGE (yea, 8GB+ is big for me) with about 246MM rows (!!), it gets damn slow and the downtime doesn't last for an eye blink.

Reminder: ALTER TABLE allows read operations while altering the table then blocks reads and writes ops when the alteration is done and needs to go live. This may vary according to the configuration

> Continue Reading

JS: Singleton as a module

When you develop a NodeJS application, you probably get to work with services and as much as possible with service dependency injection.
As I worked quite a lot with Symfony lately, I wanted to be able to manage my NodeJS services as it should be, and in some case, like a database connection: a single instance for the whole script.

I quicky looked onto Internet to see how to build a singleton in JavaScript (pardon my weak skills in this language) and I quickly found what I was (almost) looking for.

Code examples provided in the different posts I've read

> Continue Reading

PHP: Projet Silex – Templating

Oula, si vous aviez cru que le projet était tombé à l'eau, et bien non. Très très occupé ces derniers mois car je vis maintenant à New York et j'ai pas vraiment eu le temps de rédiger. Ni de trop avancer d'ailleurs.
Mais me revoilà, j'ai pas mal bossé ces dernières semaines et le projet a beaucoup changé depuis la dernière fois mais il est maintenant abouti (enfin). Pour les fidèles (si il en a encore), on retrouve encore et toujours notre road map habituelle :

Road map du projet

  1. Pré-requis et architecture
  2. Configuration de Silex
  3. Jouons avec Silex
  4. Ecriture de
> Continue Reading

PHP: Wordpress Popular Posts for the current category

Hi folks!
For my work, I luckily had to hack a client Wordpress instance... I'm glad to reached 6 years of studies after my A-Level to finally be a Wordpress hacker.

Anyway, today, my client Wordpress uses the popular plugin Wordpress Popular Posts to display various popular posts on his website. The plugin allows to exclude certain categories if you want but doesn't allow to filter for only one specific category. I read in the plugin forum that the plugin developer has this feature in his to-do list...

If you need this feature by the current version (2.2.1)

> Continue Reading

SH: md5sum -c like for Mac OSX

Okay, since I plan to upload old backup archives to the cloud with fear to lose data integrity, I wanted to calculate the MD5 hash of these archives before any manipulation. OSX has natively the MD5 command provided by OpenSSL but no argument to check automatically a file checksum against another file which would contain its checksum.
And the -r generates broken MD5SUMS pattern output (the default OpenSSL star is stripped)!

In order to be able to use the md5sum command on OSX like on other Unix platforms, I developped a small script that will behave alike. I hosted it

> Continue Reading

Introducing: joris.me

Hi! I'd like to wisely introduce you my new online resume. I worked hard to reach this level of quality so I'm kinda proud of it.

Features

  • HTML5 + CSS3
  • Spritted CSS images
  • Smooth scrolling using jQuery
  • Full responsive layout (from 320x240 to... whatever!)
  • Mobile version (goes with responsive layout)
  • Supports IE7+
  • 98/100 on Google Page Speed
  • A Grade on YSlow
  • HTTP caching + compression
  • Twitter Bootstrap
  • Semantic HTML5 design
  • RDF/XML + Dublin Core metadata

It took some time for me to realize it because I'm not a designer and I didn't know what I really wanted... Wanted something very neat,

> Continue Reading