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 | |
class JoomlaValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName | |
* @param string $uri |
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 | |
// JOOMLA LANGUAGE FILE UPDATER | |
// CONVERTS JOOMLA 1.5 FILES TO JOOMLA 1.6 FORMAT | |
// AND THEN MODIFIES ALL JTEXT USAGES TO FIT NEW FORMAT | |
// | |
// THIS IS INTENDED TO BE USED BY JOOMLA DEVELOPERS ON THEIR OWN CODE REPOSITORY | |
// NOT AGAINST A FULL JOOMLA SITE! | |
// | |
// COPYRIGHT 2011 THE THINKERY LLC |
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 | |
// Google Maps API key | |
$key = key; // Google API key | |
$mapaddress = urlencode($listing['street_number'] . " " . $listing['street_direction'] . " " . $listing['street'] . " " . $listing['street_suffix'] . " " . $listing['street_suffix2'] . ", " . $listing['city'] . ", " . $listing['state'] . " " . $listing['zip']); | |
function geocoder($mapaddress){ | |
global $key; | |
// Desired address | |
$url = "http://maps.google.com/maps/geo?q=$mapaddress&output=xml&key=$key"; |
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 | |
$tempdir = sys_get_temp_dir(); | |
echo "Your temp directory is: " . $tempdir . "<br />"; | |
$perms = fileperms($tempdir); | |
if (($perms & 0xC000) == 0xC000) { | |
// Socket | |
$info = 's'; |
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 | |
$tempdir = sys_get_temp_dir(); | |
echo "Your temp directory is: " . $tempdir . "<br />"; | |
$perms = fileperms($tempdir); | |
if (($perms & 0xC000) == 0xC000) { | |
// Socket | |
$info = 's'; |
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
# Hot Property to Intellectual Property SQL migrations | |
# DO THE COMPANY INSERTS | |
INSERT INTO jos_iproperty_companies (name, street, city, postcode, fax, phone, email, website, icon, ip_source) | |
SELECT name, address, suburb, postcode, fax, telephone, email, website, photo, id FROM jos_hp_companies WHERE 1 | |
# DO THE AGENT INSERTS | |
INSERT INTO jos_iproperty_agents (fname, lname, company, email, mobile, website, user_id, icon, ip_source) | |
SELECT SUBSTRING_INDEX(name, ' ', 1), SUBSTRING_INDEX(name, ' ', -1), company, email, mobile, desc, user, photo, id FROM jos_hp_agents WHERE 1 |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
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
select column_name from information_schema.columns where table_name='table' INTO outfile '/tmp/tmp.csv' |
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 filename_safe($filename) { | |
$temp = $filename; | |
$temp = strtolower($temp); | |
$temp = str_replace(" ", "_", $temp); | |
// Loop through string | |
$result = ''; | |
for ($i=0; $i<strlen($temp); $i++) { | |
if (preg_match('([0-9]|[a-z]|_)', $temp[$i])) { |