omissis's blog

Subscribe to RSS - omissis's blog

Fix those damn dark input fields in firefox

Ok you could say I am strange and everything but I like dark themes like ubuntu's Dark Room.
The tiny little problem is that since firefox is (not perfectly)using native widgets I ended up having black text on black controls and therefore a good bunch of headaches. After a quick search on google I found a solution on ubuntu's forums . I had some problems with it though, so I tricked and simplified it a bit in order to have it working for me. I sum up the steps needed on ubuntu 10.04:

  1. Install Stylish Firefox extension:
  2. Tools > Add-ons > User Styles > Write New Style(it' s in the bottom-right corner)
  3. Name it as you like, on ubuntuforum they call it "Fix Dark Textboxes" and then paste the following text:

    @namespace url(http://www.w3.org/1999/xhtml);

    @-moz-document url-prefix(http), url-prefix(https), url-prefix(file) {

    pre, select, input[type="button"], input[type="submit"] {
    color: white !important;
    background-color: #4C4039 !important;
    background-image: none !important;
    border-left-color: gray !important;
    border-right-color: gray !important;
    border-top-color: gray !important;
    border-bottom-color: gray !important;
    }

A new toy I bought


More or less ten days ago, when I finally came back home from Paris, I had the urgent need to buy a new gadget. My birthday together with a I-passed-an-year-far-from-home-so-now-I-deserve-a-prize feeling convinced me it was time to trash a huge amount of money on something freakin' awesome as well as freakin' pointless. Whatever, I was turning 24, I had the perfect excuse. After a "quick" tour of all the mobile phone shops in town, I landed on the good ol' giant tech store near home, after all I was missing it for one long year. In ten minutes, I was already playing with 550 euros of pure linux awesomeness: the Nokia N900. Now that some time has passed I can say it' s quite a good phone... for a nerd. The interface' s quite cool, but probably it' s too original for the normal user and takes some time to get used to it. Other than that, the operating system is Maemo, a debian-based distribution, so what can I ask more than that? :)
Multitasking is pretty cool, in fact now every time I go back to my iPod touch I feel very limited since I can't text, browse, install an app and tweet at the same time. On the other hand, especially when installing apps, the system get reeeeally slow, but still, it' s ok since I am not installing apps all the time(except for the first days of course). Other than that, I really LOVE the keyboard, way better than having one on screen.

A couple of functions "backported"

These days I am working on a new Drupal module I am going to publish in the next few weeks, and I found that D6 is lacking two nice Drupal 7 functions: user_role_grant_permissions() and user_role_revoke_permissions(). Therefore I thought to write a "backport", just in case.

omifk updated

A few days ago I pushed a bit the development of my little framework, and even if it's far to be completed, I think now it is usable. I also created a cute logo for it, irresistible! :)

Hosting Change

In the next few days I am moving this site to another provider, so some downtime could occur.

the Double Submit problem

The article is almost 6 years old but I think it' s nice and worth a read.
Basically it explains how to avoid double POST requests for a HTML form,
and highlights some related caching problems.
You can find it here: http://www.theserverside.com/news/1365146/Redirect-After-Post

it was a qt weekend

Well not really in the end, since I spent most of the time getting mad trying to integrate libircclient(and some of its flavours) in mah very first qt app, what a hell. But not everything was a pain, since finally I had the opportunity to play a bit with the qt sdk and to refresh a bit mah c++. If you wanna try something new, cool, plain and easy, point yo browser to http://qt.nokia.com/ and download the sdk, I totally recommend it.
Beware of libircclient though, it bites :P

Tags: 

Omifk released

There are some occasions in which I had to write some PHP scripts for different purposes(sitemaps, snmp and/or database data fetch, etcetera) and I' m pretty sure I' ll have to do that again in the future. For all these reasons, today I came up with the conclusion that I don't want to reinvent the wheel every time, so I had tidied up some ideas, gathered a small bunch of files into a tiny framework and voila', I put the result on google code.
Even if it' s an early version I think it could already be extended to support some command line tasks quite easily.
As many of my scripts, it takes some inspiration(as well as some code :D) from Drupal, but this time I also followed PEAR PHP coding convention(although not all of them, brackets on new line after function declaration won' t have my scalp).
If you' re curious to take a look at it, as well as use it or suggest improvements, here you are the coordinates:

http://code.google.com/p/omifk/

Don't forget about Coding Standards

In order to keep life easy, humans established some agreements called 'conventions', which could be seen as a way for simplying some common tasks.
Think about it: we live in a world made of conventions; some of them make sense, some don't, but still. In order not to get killed when we cross the street we all know it's better to wait the green light, as well as in order not to get a cold it's better to wear clothes when we go outside, etcetera etcetera.
Of course almost none of the conventions I can think about can guarantee 100% success, but in the most cases they can save us from some amount of pain and/or time.
So why not using convention when coding as well? I know it' s a topic on which a lot of documents have already been written, but every time you' ll find yourself in the situation where you have to maintain somebody else' spaghetti code, you're gonna think something like "Damm! Why going so dirty? Why didn't you follow those damn easy rules? Do you believe you're a big boy because you put 45 statements in just one line uh?".
As you can imagine this is not the best scenario, so my suggestion for keeping things a bit easier and spread friendship among developers is to read(or review once in a while) the basic coding standars.
You can finde the ones about PHP here: http://pear.php.net/manual/en/coding-standards.php

Some other interesting links:

46 Firefox' features you might not know about

Few minutes ago digging through Twitter I came across this nice article about a good bunch of new features introduced from (mainly)Firefox 3.6. It's worth reading it, so I suggest you to check it out: http://hacks.mozilla.org/2010/02/firefox-46-features/

Pages