Most requested URLs:
cat access.log | grep "GET " | cut -d\ -f7 | sort | uniq -|sort -n | tail -n50
This file contains hidden or 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 | |
// http://terenceyim.wordpress.com/2009/01/09/adding-ping-function-to-pdo/ | |
class NPDO { | |
private $pdo; | |
private $params; | |
public function __construct() { | |
$this->params = func_get_args(); |
This file contains hidden or 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 | |
class db extends PDO { | |
public function fetch_all( $query, $parameters=array() ) { | |
$read_stmt = $this->prepare_and_execute($query, $parameters); | |
$fetched_rows = $read_stmt->fetchAll(PDO::FETCH_CLASS); | |
$read_stmt->closeCursor(); |
This file contains hidden or 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 | |
ob_end_clean(); | |
header("Connection: close"); | |
ignore_user_abort(); // optional | |
ob_start(); | |
echo ('Text the user will see'); | |
$size = ob_get_length(); | |
header("Content-Length: $size"); | |
ob_end_flush(); // Strange behaviour, will not work | |
flush(); // Unless both are called ! |
This file contains hidden or 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
mysqldump --opt --compress --user=USERNAME --password=PASSWORD --host=SOURCE.HOST.HERE SOURCE_DB_NAME | mysql --user=USERNAME --password=PASSWORD --host=TARGET.HOST.HERE -D TARGET_DB_NAME -C TARGET_DB_NAME |
This file contains hidden or 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 browserSupportsCSSProperty(propertyName) { | |
var elm = document.createElement('div'); | |
propertyName = propertyName.toLowerCase(); | |
if (elm.style[propertyName] != undefined) | |
return true; | |
var propertyNameCapital = propertyName.charAt(0).toUpperCase() + propertyName.substr(1), | |
domPrefixes = 'Webkit Moz ms O'.split(' '); |
This file contains hidden or 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 | |
/** | |
* Get human readable time difference between 2 dates | |
* | |
* Return difference between 2 dates in year, month, hour, minute or second | |
* The $precision caps the number of time units used: for instance if | |
* $time1 - $time2 = 3 days, 4 hours, 12 minutes, 5 seconds | |
* - with precision = 1 : 3 days | |
* - with precision = 2 : 3 days, 4 hours |
This file contains hidden or 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
// Constants for expressing human-readable intervals | |
// in their respective number of seconds. | |
define( 'MINUTE_IN_SECONDS', 60 ); | |
define( 'HOUR_IN_SECONDS', 60 * MINUTE_IN_SECONDS ); | |
define( 'DAY_IN_SECONDS', 24 * HOUR_IN_SECONDS ); | |
define( 'WEEK_IN_SECONDS', 7 * DAY_IN_SECONDS ); | |
define( 'YEAR_IN_SECONDS', 365 * DAY_IN_SECONDS ); |
This file contains hidden or 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
/* Demo: http://www.justinaguilar.com/animations/index.html */ | |
/* | |
============================================== | |
CSS3 ANIMATION CHEAT SHEET | |
============================================== | |
Made by Justin Aguilar | |
www.justinaguilar.com/animations/ |
Most standard ways to get a favicon from a page, in preferred order
<link href="http://someserver/favicon.ico" rel="shortcut icon" />
<link href="http://someserver/favicon.ico" rel="shortcut" />
<link href="http://someserver/favicon.ico" rel="icon" />
<link href="http://someserver/favicon.png" rel="apple-touch-icon" />
<link href="http://someserver/favicon.png" rel="apple-touch-icon-precomposed" />
<link href="http://someserver/favicon.ico" rel="image_src" />