This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) { | |
// iPhone/iPod/iPad-only functionality here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ORACLE/PLSQL - NVL(A, B) EXAMPLES | |
# If A IS NULL substitute with B | |
# Example 1. if table b contains values that over-write values in table a | |
SELECT NVL(b.name, a.name) AS name FROM a left join b on a.id = b.id; | |
# Example 2. to replace NULL values with an alternative placeholder value | |
SELECT NVL(a.name, 'Unnamed') AS name FROM a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
var $grid = $('#yourGridId'); // @todo: Insert your grid selector | |
var gridData; | |
var rowIds; | |
$grid.jqGrid({ | |
// @todo: Insert your grid configuration | |
loadComplete : function (data) { | |
gridData = $grid.jqGrid('getRowData'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Split PDF file | |
* | |
* <p>Split all of the pages from a larger PDF files into | |
* single-page PDF files.</p> | |
* | |
* @package FPDF required http://www.fpdf.org/ | |
* @package FPDI required http://www.setasign.de/products/pdf-php-solutions/fpdi/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Manually automatically increment a column in MySQL | |
* | |
* Ok, so a little introduction is warranted here, because I don't just mean setting | |
* a column as 'AUTO_INCREMENT'. | |
* | |
* I am currently working on a project where a user can sort the records however | |
* they like. The order is determined by a column I have named 'sort'. When they | |
* input the data, it was random, but they wanted it to sort alphabetically by | |
* default, and rearrange from there. This quick script sets the 'sort' column to an |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Return a user's latest tweet using cURL | |
* | |
* @param string $username The username for whom you wish to fetch a tweet | |
* @return mixed The tweet if it exists, NULL otherwise | |
*/ | |
function latest_tweet($username) { | |
$url = 'http://search.twitter.com/search.json?from='.$username; |