See Migrating from Firebug and Firefox Developer Tools to get started. Also of interest was Web Console Helpers.
Category Archives: Programming
Hitchhiker’s Guide to the GDB
Found an interesting article: Hitchhiker’s Guide to the GDB.
Configure name to display in phpMyAdmin server choice
To configure the name displayed on the phpMyAdmin database login page for the server choice dropdown list set the ‘verbose’ property for the server in config.inc.php, e.g.:
$cfg['Servers'][$i]['verbose'] = 'Name to display...';
PDO: Execute a prepared statement using array for IN clause
See Example #5 here.
/* Execute a prepared statement using an array of values for an IN clause */
$params = array(1, 21, 63, 171);
/* Create a string for the parameter placeholders filled to the number of params */
$place_holders = implode(',', array_fill(0, count($params), '?'));
/*
This prepares the statement with enough unnamed placeholders for every value
in our $params array. The values of the $params array are then bound to the
placeholders in the prepared statement when the statement is executed.
This is not the same thing as using PDOStatement::bindParam() since this
requires a reference to the variable. PDOStatement::execute() only binds
by value instead.
*/
$sth = $dbh->prepare("SELECT id, name FROM contacts WHERE id IN ($place_holders)");
$sth->execute($params);
KCachegrind doesn’t open cachegrind profiler log file
So I had an issue with KCachegrind where I would open a cachegrind profile file and “nothing happened”. The status bar said the file had loaded, but the user interface widgets were all empty. Turns out clicking Settings -> Sidebars -> Function Profile loaded the part of the UI I needed to get started… everything is easy when you know how!
Disabling F6 ‘Run Main Project’ hot key in NetBeans because of G15 keyboard
I have a G15 keyboard, and I love it (but not as much as the old model!), but it occasionally causes a problem for me when I’m programming in NetBeans on Debian GNU/Linux.
The issue is that on a newer G15 the G6 key is right near the Ctrl key, and from time to time my pinky hits the G6 key which seems to be by default programmed to be the F6 key.
By default in NetBeans the F6 key is the ‘Run Main Project’ hot key, so when I accidentally press it, it fires up a Firefox window and tries to run my web app! I never configure my web apps in NetBeans, but even if I did, I don’t want to accidentally run anything due to an accidental key press.
So my solution was to disable F6 in NetBeans, and for that:
Tools -> Options -> Keymap -> Click ‘Search in Shortcuts’ -> Press F6 -> Click on the ‘…’ in the Shortcut cell for ‘Run Main Project’ (should be F6) -> Clear -> Apply -> And you’re done!
Everything is easy when you know how!
Firebug DOM panel colour-coding/legend
Found out (over here) that the colour codes in Firebug are:
Format Description Bold Black Objects Black DOM objects get in gray "Getter" functions Bold green User functions Green DOM functions Bold Red Constructor functions
Native HTML5 Drag and Drop
Found an article on Native HTML5 Drag and Drop…
window.resizeTo( … )
See here:
- You can’t resize a window or tab that wasn’t created by window.open.
- You can’t resize a window or tab when it’s in a window with more than one tab.
- Also, even if you create window by window.open(…) it is not resizable by default …see 4.
- To make window created by window.open() resizable, you must open it with resizable feature
myExternalWindow = window.open("http://example.com", "myWindowName", "resizable");
myExternalWindow.resizeTo(500,500); //resize window to 500x500
What to do if you accidentally press Ctrl+S in Vim
If you press Ctrl+S in Vim (i.e. because that’s hard-wired for ‘save’) your terminal may lockup, depending on how it’s configured.
If you want to know why, have a read here. If you just want to get on with life, press Ctrl+Q!
Everything is easy when you know how.