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 cleanupduplicates($array){ | |
$n = 0; | |
$crap = array_values(array_unique($array)); | |
$cc = count($crap); | |
for ($i = 0; $i < $cc; $i++) { | |
if ($crap[$i] != ''){ | |
$img[$n] = $crap[$i]; | |
$n++; | |
} | |
} |
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 to generate random strings | |
* @param int $length number of characters in the generated string | |
* @return string a new string is created with random characters of the desired length | |
*/ | |
function RandomString($length = 32) { | |
$randstr; | |
srand((double) microtime(TRUE) * 1000000); | |
//our array add all letters and numbers if you wish | |
$chars = array( |
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
/** | |
* returns the difference between two times | |
* @param string $start the starting time for comparison | |
* @param string $end the ending time for comparison | |
* @return array an array is populated with the time difference | |
*/ | |
function timediff($start, $end) { | |
$timediff = $end - $start; | |
$days = intval($timediff / 86400); | |
$remain = $timediff % 86400; |
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
/** | |
* compares two arrays to check if they're identical | |
* @param array $op1 the first array | |
* @param array $op2 the second array | |
* @return bool | |
*/ | |
function arrayIdentical($op1, $op2) { | |
if (count($op1) < count($op2)) { | |
return FALSE; | |
// $op1 < $op2 |
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
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers | |
Africa/Asmara | |
Africa/Asmera | |
Africa/Bamako | |
Africa/Bangui | |
Africa/Banjul | |
Africa/Bissau |
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 | |
// If your Wordpress blog isn't in the document root, | |
// you may have to change the path to wherever the | |
// Wordpress root directory | |
require($_SERVER['DOCUMENT_ROOT'].'/wp-blog-header.php'); | |
// if the user isn't logged in, this will redirect them | |
// to the login page. On successful login it will redirect | |
// them to the page this code is currently in. | |
if(FALSE === is_user_logged_in()){ |
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 script = document.createElement('script'); | |
script.async = 1; | |
script.src = '<url to script>'; | |
document.getElementsByTagName('body')[0].appendChild(script); | |
})(); |
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
<!--// Fixed for accessibility by Karl Groves 22-Oct 2013. Original Gist @ https://gist.github.com/briancollins/6365455 //--> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Stripe Getting Started Form</title> | |
<!-- The required Stripe lib --> | |
<script type="text/javascript" src="https://js.stripe.com/v2/"></script> |
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 isBlank(str){ | |
return str.replace(/\W/gi, '') == ''; | |
} |
OlderNewer