Sometimes your web application generates, on the fly, downloadable files with really horrible file names. You can use the html5 download attribute as a remedy ! Just like this : <!-- will download as "expenses.pdf" --> <a href="wtfreallybadassname9ad8f.pdf"...
Active Telephone lin...
posted by xav
If you’re a smartphone user, you might get sensible to websites making phone numbers directly usable by the phone on the webpage. it’s quite simple to code a phone sensitive link. Use this : <a href="tel:1-555-555-555">call me directly</a> Some phones or...
Oracle simple delete...
posted by xav
Well, this is a fine statement to delete duplicates in a table : DELETE FROM table1 A WHERE A.rowid > ANY ( SELECT B.rowid FROM table1 B WHERE A.ID = B.ID and any additional condition ) and other conditions on...
Get your Oracle DB c...
posted by xav
Here goes one fine and simple SQL statement to get your character set from your Oracle DB. SELECT * FROM nls_database_parameters WHERE parameter = 'NLS_CHARACTERSET' That’s it.
WordPress Quick tip ...
posted by xav
If you want to be able to use shortcodes in widgets, like a text widget for example. Make sure to have this line somewhere in your functions.php file (in your theme). <?php //line to enable shortcodes in widgets add_filter('widget_text', 'do_shortcode'); ?>
Mysql Replace functi...
posted by xav
Here is a quicky to replace a string inside a column: update yourTable set theColumn = replace(theColumn,'oldString','newString')
Quickly remove folde...
posted by xav
Lately I did wanted to remove efficiently all .svn folders (yes..from svn) inside a project with tones of folders and sub folders. Here under is the command I used. But before trying it, be sure to be in the right root folder from where you want to remove the .svn folders. The trick here is to...
BODI : Get the table...
posted by xav
Imagine you have to provide a list of tables (I mean, an editable one…that you can copy paste…) used by a dataprovider’s owner. If you can get connected to your SAP BODI repository you could use this request: select distinct descen_obj from AL_PARENT_CHILD where...
Purify your inputs i...
posted by xav
When working with my models in Yii a tried to inject a javascript in a text area, a simple alert. And the alert popped up when I went to browse the content of my model. Hopefully, we can prevent javascript injection, and more by using a php library called HTMLPurifier. Yii does include this...
PHP and Oracle
posted by xav
Here goes a tiny snippet that should get you started by using Oracle as your database instead of the classic MySql RDBMS. <?php // At first, get connected to the instance of your RDBMS $conn = oci_connect("user", "password",...
Debug the Hard Way
posted by xav
Sometimes you just need plain debug on an environment where you do not control the PHP settings. To be able to see what is going wrong in your PHP page just add the following code in the head of your page. <?php error_reporting(E_ALL); ini_set('display_errors',...


Abduzeedo