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 get_join(){ | |
$keys = array_keys($_GET); | |
$url = '?'; | |
$first = true; | |
for($i = 0; $i < count($keys); $i++){ | |
if(!$first){ | |
$url .= '&'; | |
} | |
$url .= $keys[$i].'='.$_GET[$keys[$i]]; | |
$first = false; |
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 query_string_remove(find, val){ | |
// get query string, remove ? and split on & | |
qryStr = window.location.search.replace("?", ""); | |
qryPrts = qryStr.split('&'); | |
// assume search will fail, for return value | |
found = false; | |
// relies on jQuery for simplicity of this function | |
// use your own foreach function if you prefer | |
jQuery.each(qryPrts, function(i, v) { |
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
.threeD{ | |
color:rgba(0,255,255,0.5); | |
text-shadow: rgba(255,0,0,0.5) -4px 0px 0px; | |
padding-left:4px; | |
} |
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
.loader{ | |
color: #555; | |
font-family: sans-serif; | |
font-size: 3em; | |
text-align: center; | |
-webkit-border-radius: 50%; | |
border-radius: 50%; | |
border: 5px solid #555; | |
width:100px; | |
height:100px; |
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
/* taken from this comment on PHP.net - http://php.net/manual/en/function.rename.php#88081 */ | |
//changes files in $directory with extension $ext1 to have extension $ext2 | |
//note that if file.ext2 already exists it will simply be over-written | |
function changeext($directory, $ext1, $ext2, $verbose = false, $testing=true) { | |
if ($verbose && $testing) { echo "Testing only . . . <br />";} | |
$num = 0; | |
if($curdir = opendir($directory)) { | |
if ($verbose) echo "Opening $directory . . .<br />"; | |
while($file = readdir($curdir)) { |
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
// credit to Sam (https://github.com/sambenne) for this | |
// saving as Gist so I don't lose it. | |
function objectLength(obj) { | |
try { | |
return Object.keys(obj).length; | |
} catch(err) { | |
var total = 0; | |
for(var k in obj) { | |
if(obj.hasOwnProperty(k)) { |
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
// taken from http://stackoverflow.com/a/6969486/1734964 | |
// saved for my own laziness | |
function escapeRegExp(str) { | |
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); | |
} |
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
// taken from http://stackoverflow.com/a/3079423/1734964 | |
// saved for my own forgetfulness | |
function str_shuffle(string) { | |
var parts = string.split(''); | |
for (var i = parts.length; i > 0;) { | |
var random = parseInt(Math.random() * i); | |
var temp = parts[--i]; | |
parts[i] = parts[random]; | |
parts[random] = temp; |
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
jQuery(document).ready(function(){ | |
twitter(); | |
}); | |
/* | |
* twitter() | |
* | |
* only parameter is an object of options: | |
* | |
* profile (string) The profile to pull tweets from |
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
/* drop shadows */ | |
.drop-shadow.top { | |
box-shadow: 0 -4px 2px -2px rgba(0,0,0,0.4); | |
} | |
.drop-shadow.right { | |
box-shadow: 4px 0 2px -2px rgba(0,0,0,0.4); | |
} | |
.drop-shadow.bottom { | |
box-shadow: 0 4px 2px -2px rgba(0,0,0,0.4); | |
} |
OlderNewer