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
<select name="timezone"> | |
<?php | |
$timezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL); | |
foreach ($timezones as $timezone) | |
echo '<option value="'.$timezone.'">'.$timezone.'</option>'; | |
?> | |
</select> |
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
#Get ready | |
sudo apt-get update | |
sudo apt-get upgrade | |
#Install apache | |
sudo apt-get install apache2 | |
#Install mysql | |
sudo apt-get install mysql-server php5-mysql | |
#Set up mysql | |
sudo mysql_install_db | |
sudo mysql_secure_installation |
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 ($) { | |
$.fn.sexyTime = function (options) { | |
var opts = $.extend({}, $.fn.sexyTime.defaults, options); | |
var time = opts.time; | |
return this.each(function() { | |
var position = $(this).position(); | |
$(this).css("z-index", "100"); | |
$(this).css("position", "relative"); | |
$(this).css("text-align", "center"); |
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
//Before now or writing your own function you could only do String.prototype.replacewith a search and a replacement, | |
//or an array of searches to be repalced with their matching item in an array of replacements. | |
//Meaning you couldn't do something like replace all question marks in `cake ? pie ? noodles` with a matching | |
//item in an array of replacements, like this: `thatString.replace("?", ["meat","veggies"])` and get something like | |
//`cake meat pie veggies noodles`, but now you can! :D (note: number of occurences of search must match count() of $replace) | |
//"?no?".replaceArray("?", ["s","w"]) //returns `snow` | |
if (!String.prototype.replaceArray) { | |
String.prototype.replaceArray = function(find, replace) { | |
var x = 0 |
When using the battle.net API amounts of currency (like how much money you have, or how much a buyout for an auction item is) are displayed as a simple amount of copper (example: 174056); And that's not human readable.
So, I made a little baby function to format into either g s c or the padded version (adds a 0 in front of silver and copper if it's a single digit).
Hope someone needs this eventually :)
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
Ok, so when you serialize a form in JQuery - $('#my-form').serialize() - you get something like | |
title=cake&date=2014-07-10 2:56PM&content=cake cake cake&tags=cake&new=post | |
Obviously, that isn't super useful to PHP and unserialize() does nothing for it. | |
So, I made unJQSerialize(); which is a little function to go through the serialized form and break it down into an actual PHP array. | |
When unJQSerialize() is used, you'll get something like | |
[title] => cake [date] => 2014-07-10 2:56PM [content] => cake cake cake [tags] => cake [new] => post |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<div id="select"> | |
<div class="Cerulean"><img src="http://bootswatch.com/cerulean/thumbnail.png" width="250px"><br>Cerulean<hr></div> | |
<div class="Cosmo"><img src="http://bootswatch.com/cosmo/thumbnail.png" width="250px"><br>Cosmo<hr></div> | |
<div class="Cyborg"><img src="http://bootswatch.com/cyborg/thumbnail.png" width="250px"><br>Cyborg<hr></div> | |
<div class="Darkly"><img src="http://bootswatch.com/darkly/thumbnail.png" width="250px"><br>Darkly<hr></div> | |
<div class="Flatly"><img src="http://bootswatch.com/flatly/thumbnail.png" width="250px"><br>Flatly<hr></div> |
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
At some point in my life I needed to use JQuery's toggle(), show(), and hide() functions but could not use JQuery, so I made claps.js. | |
I have no idea why anyone else would need this -heck, I can't remember why I needed it-, but here it is anyways. | |
Enjoy. |