abidibo.net

Weblog


About responsive tables

css3 html5 responsive-design

2013 was the year of responsive design. And 2014 too.

There are many html5/css3 frameworks which provide components, css classes, js libraries etc... that you can use to speed up the process of creating a good and responsive web interface.

There is a sort of vacuum indeed, when dealing with html tables. Do not get me wrong, this is not a fault of the frontend frameworks, but it is an intrinsic problem, due to the nature of tables. The ...

read the full post


How to get the mouseovered half of an element

events javascript

Today I'll write a very simple and short post about a very simple function that you can use to retrieve in which half (left/right) of an element the mouse is moving towards. The function is written in vanilla javascript, no frameworks are involved.

Given the element which captures the event and the event itself the function return the string 'left' or 'right' depending on the cursor position over the element.

/*
 * Gets the mouseovered half of an element
  ...

read the full post


Singleton, the PHP way

patterns php programming singleton

I realized that even if the great part of my work consists in programming PHP stuff, I rarely write about PHP in my posts, maybe because I really don't like it?

But today I'll write about a way to implement the singleton pattern with PHP.

This is quite an easy job making use of PHP 5.3.0, thanks to the "Late Static Binding" feature. In particular we'll use the get_called_class method and the static keyword. Notice that ...

read the full post


Javascript frameworks are really powerful, when you need them

javascript jquery mootools performance programming testing

Introduction

I've always used some kind of javascript framework when developing frontend stuffs. Mootools, jQuery, extjs and friends. All such frameworks provide a set of useful functionality, but above all in my opinion, they provide what is crucial for a web developer: cross browser compatibility.
The time you'll spend in writing cross browser code, even for a small project, is huge, especially if your software must support IE<9, and especially at the beginning, since you need to learn all browser ...

read the full post


Javascript event dispatcher

javascript programming

Update 11/2017

This ideas finally became a npm package: js-event-dispatcher

Introduction

Too much time has passed since my last post, so today I'll write about a simple javascript component, an event dispatcher which allows two entities to communicate each other.

The simplest use case I can think of is the one in which we have an object which emits an event and another object which should listen to such event.

We could implement all the stuff without the event ...

read the full post


Playing with tideSDK, create a brightness controller for fluxbox

applications fluxbox tideSDK

My ubuntu machine running fluxbox has all the features I desire. I've set up all kinds of short-cuts, menu and so on..., I've written my scripts to toggle between the notebook LCD and external monitors and I'm very happy with it. One thing more which I wanted was a brigthness control widget, but at the same time I disliked to install gnome or kde packages, and I could live simply with xbacklight and its get and set options. So what I needed is a simple interface to controll the xbacklight command.

And here comes tideSDK. After some reading about xlib and watching some examples I understood that now I don't have enough time to dive into it, so I decided ...

read the full post


Mootools IntervalController mixin

javascript mixin mootools programming

How many times do you need to implement a functionality which has to be run every n seconds and possibly should be stopped and resumed? Not so often probably but it happens and happened to me just today, for this reason I decided to write a mootools Mixin so that I can reuse this code when I need it.

The code

/**
* IntervalController Mixin
* Provides methods to start, stop and resume
* a setInterval functionality
*/
var IntervalController = new Class({
  _started: false ...

read the full post


How to create your own speech recognition application with tasker

android tasker tips

Tasker is an awesome android app which let's you create and execute deep level tasks based on context in user-defined profiles, or widgets

What captured my attention is its javascript API which let's you interact with many phone functions through javascript, so you can imagine how many nice job you can accomplish with this app.

Here we'll see how you can implement your own speech recognition application so that your phone will answer to your defined commands!

We'll see how to get it through tasker interface, but then we'll see that it is possible to use javascript(let) to enhance our application.

Create the speech recognition task

Ok, let's start by creating our main task, here comes the description:

A1 ...

read the full post


ajsut, abidibo's javascript unit testing library

ajsut javascript testing

Introduction

I know since time ago' that writing tests for our applications is one of the programming best practices, django taught me that many years ago, and gipi repeated it to me many times. But as many best practices it costs time to acquire the necessary skills, and time to start the implementation.

Maybe the best thing could be to place the testing phase at the beginning of the development flow, as the test driven development process shows you, so that you're forced to write tests for your application and you are forced to focus on code specifications, targets, runtime conditions, and all these things let's you write a cleaner and reusable code.

Actually is not so simple to change ...

read the full post


Your Smartwatch Loves Tasker!

Your Smartwatch Loves Tasker!

Now available for purchase!

Featured