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
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png | |
//http://blog.shvetsov.com/2013/02/grab-android-screenshot-to-computer-via.html |
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
find ./* -type f -name "*.png" -exec optipng -o2 {} \; | |
find ./* -type f -name "*.jpg" -exec jpegoptim -m70 --strip-all {} \; |
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
private function ocDownloadImg($url){ | |
$filename = end(explode('/', $url)); | |
$saveIn = DIR_IMAGE . '/downloaded/' . $filename; | |
$ch = curl_init($url); | |
$fp = fopen($saveTo, 'wba'); | |
curl_setopt($ch, CURLOPT_FILE, $fp); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_exec($ch); | |
curl_close($ch); | |
fclose($fp); |
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 Css() { | |
var regras = []; | |
function __constructor(){ | |
$('head').append('<style type="text/css" custom></style>'); | |
} | |
this.addRule = function(regra, conteudo) { | |
return $('style[custom]').append(regra + ' { ' + conteudo + ' } '); | |
}; |
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
$('#inputID').on('input',function(){ | |
if($(this).val().indexOf('-')!=-1){ | |
if($(this).val().length==15){ | |
var _value = $(this).val(); | |
_value = _value.split(''); | |
var iTraco = _value.indexOf('-'); | |
var letterAfter = _value[iTraco+1]; | |
_value[iTraco] = letterAfter; | |
_value[iTraco+1] = '-'; | |
_value = _value.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
$(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') | |
} |
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
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
"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
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) { |