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 | |
add_action('admin_footer', 'qtranslate_slug_snippet'); | |
function qtranslate_slug_snippet() { | |
?> | |
<script> | |
function string_to_slug(str) { | |
str = str.replace(/^\s+|\s+$/g, ''); // trim | |
str = str.toLowerCase(); |
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
// Handle links with href started with '#' only. | |
jQuery(document).on('click', 'a[href]', function(e) { | |
// target element id | |
var id = jQuery(this).attr('href'); | |
if (!id.match(/^#/) || jQuery(id).length === 0 || jQuery(this).hasClass('ui-tabs-anchor')) { | |
return; | |
} | |
// prevent standard hash navigation (avoid blinking in IE) |
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
/** | |
* Based on goog.userAgent.flash | |
* @license Apache-2.0 | |
* @see {@link https://code.google.com/p/closure-library/source/browse/closure/goog/useragent/flash.js} | |
*/ | |
function getFlashVersion() { | |
var getVersion = function(desc) { | |
var matches = desc.match(/[\d]+/g); | |
if (!matches) { | |
return ""; |
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 | |
define('FLAG_MATCHED', 1 << 0); | |
class StringScanner implements ArrayAccess | |
{ | |
protected | |
$str = '', | |
$len = 0, | |
$flags, |
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
find . -type f -exec chmod 644 {} \; | |
find . -type d -exec chmod 755 {} \; |
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
PURGE BINARY LOGS BEFORE '2011-10-30 10:06:06'; |
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
diff -rupN original/ new/ > original.patch |
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 | |
function utf8_translit($string) { | |
$characters = array( | |
#"" /* 0080 '<control>' */ => "", | |
#"" /* 0081 '<control>' */ => "", | |
#"" /* 0082 'BREAK PERMITTED HERE' */ => "", | |
#"" /* 0083 'NO BREAK HERE' */ => "", | |
#"" /* 0084 '<control>' */ => "", | |
#"" /* 0085 'NEXT LINE (NEL)' */ => "", |
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 | |
function geocode_address($address) { | |
$output = array('address' => $address); | |
$response = json_decode(file_get_contents("http://maps.googleapis.com/maps/api/geocode/json?address=" . urlencode($address) . "&sensor=false")); | |
switch ($output['status'] = $response->status) { | |
case 'OK': | |
$output['latitude'] = $response->results[0]->geometry->location->lat; | |
$output['longitude'] = $response->results[0]->geometry->location->lng; | |
$output['location_type'] = $response->results[0]->geometry->location_type; |
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
javascript:(function(){zoomFile.size=zoomFile.maxSize;top.location.href=zoomFile.mGetImageURL()})(); |
OlderNewer