Skip to content

Instantly share code, notes, and snippets.

@Agneli
Agneli / Time Converter
Last active December 22, 2015 05:38
Function to convert time (type chronometer - 4:57:13) to seconds.
function seconds(time) {
var split = time.split(':');
if (split.length == 1) {
var seconds = split[0];
//alert(seconds);
} else if (split.length == 2) {
@Agneli
Agneli / Date Convert
Last active December 22, 2015 05:39
Function to convert date in ISO 8601 format (Y-m-d) to (d/m/Y) format.
function Data($date) {
$date_1 = explode("-", $date);
$date_2 = $date_1[2] . "/" . $date_1[1] . "/" . $date_1[0];
return $date_2;
}
@Agneli
Agneli / jQuery placeholder
Last active August 29, 2015 13:56
Placeholder effect with jQuery
<!--HTML-->
<input type="text" name="email" id="email" value="digite seu e-mail" />
<!--Javascript (jQuery)-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
@Agneli
Agneli / estados.html
Created November 12, 2014 11:59
Select de estados brasileiros
<!-- value com sigla e option com nome -->
<select>
<option value="AC">Acre</option>
<option value="AL">Alagoas</option>
<option value="AM">Amazonas</option>
<option value="AP">Amapá</option>
<option value="BA">Bahia</option>
<option value="CE">Ceará</option>
<option value="DF">Distrito Federal</option>