And I’ve been back for a while now!

I actually missed my flight but caught one the day after, so everything went better than expected.

I spent a whole lot more than I wished to (the two-way train from Cambridge to London costs £45 and I had to book a new flight which amounted to approximately 100€).

Had to go to London to the embassy, where I got a temporary passport valid for a limited time only, which brought me back home safely.

No posts for a while because I’m lazy again!

Quick update though:
– I started working on a couple of new projects, one of which is my CV.
– I redesigned my url eater, Waka. Feel free to use it!

More soon, as I am about to start coding my first iOS app (which might end up being a HTML5+CSS3+JS game compiled with PhoneGap or sth).

If you, like me, own the best mobile phone in the universe, the Nokia Lumia 920, and design websites, you might have noticed that responsive sites are not responsive on this device.

This is a IE10 bug. To fix this, you should include the following snippet in the head (or wherever really) of your index file.

if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
    var msViewportStyle = document.createElement("style");
    msViewportStyle.appendChild(
        document.createTextNode(
            "@-ms-viewport{width:auto!important}"
        )
    );
    document.getElementsByTagName("head")[0].
        appendChild(msViewportStyle);
}

I don’t remember where I got this one, so no credits or reference, but it works!

To display a custom page template you usually rewrite the default WordPress query that is used to read the post / page content and display it: $wp_query.

By doing so, you end up somehow breaking it’s flow and don’t let it finish correctly (this is not what happens, you really break it though).

This, for instance, prevents the query to correctly set the current-menu-item and other css classes to the menu items that should be marked as selected when visiting a page with a custom template inside.

Let’s see where it goes wrong.

Continue reading

We all probably noticed more than once that PayPal’s got a very bad conversion rate, which usually makes you spend more money than expected, when buying stuff in another currency.

If you are like me and don’t want to spend 30€ instead of 25€ and donate the rest to PayPal because you are buying in a foreign currency, follow the steps below and let your bank manage the currency conversion instead of PayPal.

Your bank’s conversion rate will usually be similar to the one that Google uses when you use it to convert the price.

Click here to read more.

Set the permissions of all the files to 664 (current directory and all subdirectories)
find . -type f -exec chmod 664 {} +

Set the permissions of all the directories to 775 (same as above)
find . -type d -exec chmod 775 {} +

You can already find this process on other sites around the web, but it was only in a comment I found out that this only works with default forms (and not with custom made forms created by you). This is why you need to edit NewForm.aspx, DispForm.aspx or EditForm.aspx.

Also, to be able to use this you must be a Site Collection administrator.

This is done using prototype.js and SPUtility.

Click here to see the code.

To test only one condition, <xsl:if></xsl:if> is used.

<xsl:if test="price > 10">
    <tr>
        <td><xsl:value-of select="title"/></td>
        <td><xsl:value-of select="artist"/></td>
    </tr>
</xsl:if>

To express multiple conditional tests you should use a combination of <xsl:choose> and <xsl:when>.

<xsl:choose>
    <xsl:when test="price>'10'">
        <td bgcolor="#ff00ff">
            <xsl:value-of select="artist"/>
        </td>
    </xsl:when>
    <xsl:otherwise>
        <td>
            <xsl:value-of select="artist"/>
        </td>
    </xsl:otherwise>
</xsl:choose>