Orphan next post arrow in Safari and Chrome

Motivation: in the single post page, the arrow that points to the next post appears one line below the ‘Next’ text in Safari and Chrome browsers.
Solution: I don’t know if this is a ‘good’ way to solve it or if I should report it somewhere, but as a quick fix I’ve edited my child style.css file adding the following:

1
2
3
4
5
6
#nav-single .nav-next {    
    float:right;
}
#nav-single .nav-previous {
    float:left;
}  
#nav-single .nav-next {    
    float:right;
}
#nav-single .nav-previous {
    float:left;
}  

VIM tab configuration

Motivation: I like to edit files using VIM. In my server (Bluehost) the default configuration makes my ‘tab’ to produce really width spaces and I want it to be the size of 4 spaces.
Solution: I edited a file .vimrc and I placed in my home directory in my server. The content of this file is the following:

1
2
3
4
5
set expandtab
set smartindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set tabstop=4
set softtabstop=4
set shiftwidth=4

Password Protect a Directory with .htaccess

Motivation: protect some directories from being accessed without authorisation.
Solution: using the .httaccess file. You just have to configure one and place it into the directory you want to protect. The code inside the file would look something like this:

1
2
3
4
AuthType Basic
AuthName "guest"
AuthUserFile "/home/user/.htpasswds/public_html/directory2storepass/passwd"
require valid-user
AuthType Basic
AuthName "guest"
AuthUserFile "/home/user/.htpasswds/public_html/directory2storepass/passwd"
require valid-user

Then you have to place the password in the directory you have chosen.
The source I’ve used.

wp-cv plugin creation

Motivation: I hate standard text-based CVs. They are so boring and I want something that gives you a quick look into the main things somebody has done. And I also want it to be strongly ‘time-based’. Plus: I want a very very simple design and I need to have a functional version very very soon.
Motivation(II): I want to play a little bit with HTML5, the Canvas and making a WP plugin.
Disclaimer: As I need it to be done immediately because I want to apply for a specific candidature I will be doing stuff without thinking very much on code prettiness. Anyway, I’ll promise it will be an iterative process to I’ll be improving it.
Solution:

  1. Starting point: googling about I found this post. So I must say thanks to Simon Harris, I’ll start based my work on his example.
  2. Changed mouse cursor in mouse EventListeners. I want to have the ‘dragging’, ‘mouseover’ etc. pointers. Example:
    1
    2
    3
    4
    5
    
    if (activities[i].contains(mx, my)) {
        e.target.style.cursor = 'pointer'; // My mouse cursor is in the area of an activity, so I change cursor to 'pointer' style.
        return;
    }
    else e.target.style.cursor = 'auto';
    if (activities[i].contains(mx, my)) {
        e.target.style.cursor = 'pointer'; // My mouse cursor is in the area of an activity, so I change cursor to 'pointer' style.
        return;
    }
    else e.target.style.cursor = 'auto';
  3. For the ‘more information’ area, I want to be able to offer rich text edition. I found this one, Aloha Editor, which I’m going to try.
      Cancelled this step right now. I’ve tried the editor but format was not appearing as I desired and right now I’m not going to spend time on it. Let’s assume we’ll edit information manually adding html format
  4. Once I click on an activity I want to update the ‘More information’ section. I do this using Prototype. Very easy to install (by only including the .js file: <script type="text/javascript" src="js/prototype.js"></script>

    ) and very easy to use (in the activities.js file do something like this

    document.getElementById("information").update("<i>"+MORE_INFO_MSG+"</i>");

    NOTE: I finally chose jQuery because I want to use jQuery sliders as some browsers don’t support “range” input sliders in HTML5 yet. Using Prototype and jQuery leads to some conflicts (which can be solved) but I prefer not to mix them. Usage now would be:

    $("#information").html("<i>"+MORE_INFO_MSG+"</i>");
  5. I want my Activity elements to move across the screen so I will display a slider and I’ll apply a SCREEN_OFFSSET to the X position of my activities. This will do the trick.

Right now I publish it as it is, very ad-hoc. But I had a deadline where I wanted to show it. In fact there is much more ‘automatized’ than what you can see (for example, scrolling in horizontal direction). But I promise I’ll keep working on it and finally integrate it as a WordPress plugin.

Some stuff written in catalan, just a TODO list to myself…
a fer:
– en un futur desplaçar només en horitzontal seleccionant qualsevol punt de sa pantalla (mostrar maneta de drag)
– fer zoom de tots a l’hora
– posar els més antics baix i construir cap amunt (activitats posteriors tenen bases o fonaments amb coses d’abans)
– en un futur posar totes les activitats en transparent menys la seleccionada (hi ha un ctx.globalAlpha, però no mola perquè ho posa tot)
– afegir scrolling de nou

My mistake

A little ‘siesta’ in the bus.
Missed my stop.
“1.8 miles from home, 37 minutes walking”, Google Maps said.
F**k! Ffffuuuuuuu!
“0 ºC”, Google Weather said.
F**k, f**k, f*ck, fuck!
Started jogging, why not?

A car approaches me:

– Excuse me, is this the way to get to Wheatly?

– No sir, I’m afraid it’s the next one!

– You saved my day! – the guy was almost in tears (of happiness, I assume)

Mental note: pay attention whenever you make a mistake, you might be saving someone’s day!

WP-reCAPTCHA: javascript error in pages without submit button

[UPDATE]: it seems that the problemis solved since version 3.1.5 (but I’m not certain if this is version 3.1.5 or since 3.1.6. Anyway, you don’t need to read this post if you are using one of those versions or above.

Motivation: I’m using the WP-reCAPTCHA plugin and there is a javascript error in every page where I didn’t include any post comment box.
Solution: Found here. But I’m copying the solution here anyway:
“In the recaptcha.php page, there’s a function called “save_comment_script”. In the middle of it is a block of code that currently looks like this”

<script type="text/javascript">
var sub = document.getElementById('submit');
document.getElementById('recaptcha-submit-btn-area').appendChild (sub);
document.getElementById('submit').tabIndex = 6;
if ( typeof _recaptcha_wordpress_savedcomment != 'undefined') {
	document.getElementById('comment').value = _recaptcha_wordpress_savedcomment;
}
document.getElementById('recaptcha_table').style.direction = 'ltr';
</script>

Change that code to look like this:

<script type="text/javascript">
if(document.getElementById('submit') != null)
{
	var sub = document.getElementById('submit');
	document.getElementById('recaptcha-submit-btn-area').appendChild (sub);
	document.getElementById('submit').tabIndex = 6;
	if ( typeof _recaptcha_wordpress_savedcomment != 'undefined') {
		document.getElementById('comment').value = _recaptcha_wordpress_savedcomment;
	}
	document.getElementById('recaptcha_table').style.direction = 'ltr';
}
</script>

CoRD – Remote Desktop Protocol

Motivation: I need to connect to from my Mac to a remote desktop which is running a Windows server. I want a tool to be able to do this connection by using RDP (Remote Desktop Protocol).
Solution: I found this software, CoRD, which works better than the Microsoft Remote Desktop Connection for Mac (haven’t tried any others).
Issues: I cannot use the local key ‘Alt’, I still have to figure it out!
[SOLVED]: How silly am I?! Everything works so smooth… What happened is that I’m so used to press on my left ‘Alt’ key (this one doesn’t work once you’re in Windows) but the equivalent in the right hand side words perfectly.