Flabby Rabbit | The offical home of The Rabbit

Archive for the "Coding" Category

Firebug Lite in IE

Anyone who has tried to make their projects work on ALL browsers (including IE6 and 7) will know the headache that it can become. With no real developer tools available it can be incredibly difficult to trace and debug problems. When you start using Firebug in Firefox or Inspect Element in Chrome you quickly forgot [...]

Read More ›

External MySQL database with Node.js

Getting node to connect to a local database is a piece of cake, but when trying to connect externally I found very little on the internet … and ended up just guessing until it worked. First you need to get nodes mysql plugin installed: npm install mysql “The mysql module is entirely written in Node.js, [...]

Read More ›

Drag and drop targets with jQuery

Final result: http://www.bbc.co.uk/news/health-17235058

Read More ›

Multi line strings in Javascript

String concatenation is the most common method of formatting long strings in Javascript, but it isn’t the only or best way. For better performance try using backslashes to split up your lines. Backslashes var text = "I am a long string that I would\ like to split up on to multiple lines to keep my [...]

Read More ›

Running a function after page execution

“Registers a callback to be executed after script execution finishes or exit() is called.” – php.net Here is a simple class to show the execution time of a page: <?php     class logger {                 private $exec_start, $exec_time;                 function [...]

Read More ›

Quick and easy way to avoid CSS hacks

Probably the most incredibly useful snippet I have learnt recently. It’s beautifully simple and unbelievably essential. Creating websites for such a wide variety of platforms is hard enough but then when you throw IE6 and no script into the mix things can become very messy. Replace the tag with the following code and most of [...]

Read More ›

Deleting entire row based on column value

I needed to remove all rows in an excel sheet where column A was blank. With 4000 rows to sort through I thought I would attempt to write my first macro to do the job for me. I have no prior knowledge of VB so didn’t expect to get very far. Boom, done – all [...]

Read More ›

Using SSI effectively

Server Side Includes (SSI) is a simple interpreted server-side scripting language. SSI is mainly used to include files inside other files, much like PHP includes. Simple include: File: main.html <!–#set var="inc" value="/inc/header.inc" –> Using variables to include files: File: main.html <!–#set var="inc" value="/inc/header.inc" –> <!–#include virtual="${inc}"–> Passing variables to create dynamic includes using SSI and [...]

Read More ›

Setting default monitor for Ubuntu

When using dual screen the gnome panels automatically get attached to the default monitor. If you have something like nvidia x-config you can easily change this using their software, but what if you don’t? Open up a new terminal window and enter: xrandr –prop | grep "[^dis]connected" | cut –delimiter=" " -f1 This will display [...]

Read More ›

Creating JSON Objects with Android

After starting a new project utilizing Android and a server written in C++ I noticed that although Android has a built in JSON library there is little to no information about how to implement anything useful. The majority of responses online point users to using an additional library such as GSON. This is all well [...]

Read More ›

 

Essentials