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
//funciona com motor do safari e chrome | |
function getTimestamp(brDate){ | |
return new Date(brDate.split('/').reverse().join("-")); | |
} |
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
$directory = dir(getcwd()); | |
$directory->$path; |
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 GetUserIP() { | |
if (isset($_SERVER)) { if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) | |
{ $ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; } | |
elseif(isset($_SERVER["HTTP_CLIENT_IP"])) | |
{ $ip = $_SERVER["HTTP_CLIENT_IP"]; } | |
else { $ip = $_SERVER["REMOTE_ADDR"]; } | |
} | |
else { if ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) | |
{ $ip = getenv( 'HTTP_X_FORWARDED_FOR' ); } | |
elseif ( getenv( 'HTTP_CLIENT_IP' ) ) |
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
param = 'KEY_PARAMETRO'; | |
q = location.search.replace('?', '&').split('&'); | |
i = 0; | |
while(i < q.length){ | |
value = (q[i].split('=')[0] == param? q[i].split('=')[1] : null); | |
i++; | |
} | |
console.log(value); |
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
//need angular. ljs = array de objetos | |
function getLocation(ljs){ | |
angular.forEach(ljs, function(value, key){ | |
setTimeout(function(){ | |
$.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address='+value.MAPS+'&sensor=false', null, function (data) { | |
ljs[key] = $.extend(ljs[key],data.results[0].geometry) | |
console.log(JSON.stringify(ljs)); | |
}); | |
}, 1000); |
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
directionsService = new google.maps.DirectionsService(); | |
directionsDisplay = new google.maps.DirectionsRenderer(); | |
directionsDisplay.setMap(map); | |
var request = { | |
origin: lojas[0].location, | |
destination: lojas[1].location, | |
travelMode: google.maps.TravelMode.DRIVING | |
}; | |
directionsService.route(request, function (result, status) { |
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
"Esse seu site é uma bosta" |
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 MascaraMoeda(objTextBox, SeparadorMilesimo, SeparadorDecimal, e){ | |
var sep = 0; | |
var key = ''; | |
var i = j = 0; | |
var len = len2 = 0; | |
var strCheck = '0123456789'; | |
var aux = aux2 = ''; | |
var whichCode = (window.Event) ? e.which : e.keyCode; | |
if (whichCode == 13) return true; | |
key = String.fromCharCode(whichCode); // Valor para o c�digo da Chave |
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
preg_replace('/^([\d]{4})-([\d]{2})-([\d]{2})$/', '$3/$2/$1', $date); |
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
$(document).ready(function() { | |
var _width = $('#logo').width(); | |
var _min = 105; | |
function parallax(s){ | |
width = _width - ($(window).scrollTop() / 0.5); | |
if( width > _min){ | |
$('#logo').css('width', width + 'px'); | |
}else{ | |
$('#logo').css('width', _min + 'px') | |
} |
OlderNewer