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
<?php | |
session_start(); // Sessao do php deve estar ativa | |
// datetimezone | |
date_default_timezone_set('America/Sao_Paulo'); | |
// autoloader gerado pelo composer | |
require_once "vendor/autoload.php"; | |
// configurar APP_ID e SECRET |
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() { | |
var script, | |
scripts = document.getElementsByTagName('script')[0]; | |
function load(url) { | |
script = document.createElement('script'); | |
script.async = true; | |
script.src = url; | |
scripts.parentNode.insertBefore(script, scripts); |
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
/* | |
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/ | |
* Better handling of scripts without supplied ids. | |
* | |
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function. | |
*/ | |
(function(doc, script) { | |
var js, | |
fjs = doc.getElementsByTagName(script)[0], |
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
<?php | |
function cep_dados($cep) | |
{ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'http://www.buscacep.correios.com.br/servicos/dnec/consultaLogradouroAction.do'); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_POST, true); |
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
daAyx | |
----- | |
A [Pen](http://codepen.io/anon/pen/daAyx) by [Captain Anonymous](http://codepen.io/anon) on [CodePen](http://codepen.io/). | |
[License](http://codepen.io/anon/pen/daAyx/license). |
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 CalcRadiusDistance(lat1, lon1, lat2, lon2) { | |
var RADIUSMILES = 3961, | |
RADIUSKILOMETERS = 6373, | |
latR1 = this.deg2rad(lat1), | |
lonR1 = this.deg2rad(lon1), | |
latR2 = this.deg2rad(lat2), | |
lonR2 = this.deg2rad(lon2), | |
latDifference = latR2 - latR1, | |
lonDifference = lonR2 - lonR1, | |
a = Math.pow(Math.sin(latDifference / 2), 2) + Math.cos(latR1) * Math.cos(latR2) * Math.pow(Math.sin(lonDifference / 2), 2), |
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
// add the filter to your application module | |
angular.module('yourAppName', ['filters']); | |
/** | |
* Truncate Filter | |
* @Param string | |
* @Param int, default = 10 | |
* @Param string, default = "..." | |
* @return string | |
*/ |
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
<?php | |
function indent_json ($json) | |
{ | |
$result = ''; | |
$pos = 0; | |
$strLen = strlen($json); | |
$indentStr = "\t"; | |
$newLine = "\n"; | |
$prevChar = ''; |
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
// Declares an object | |
var layout = {}; | |
// Mount function | |
layout.mount = function (origin, data) | |
{ | |
// Receives HTML content |
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
#!/bin/bash | |
echo "Installing meld..." | |
apt-get install meld -y -qq | |
echo "Meld [OK]" | |
echo "Creating meld custom script..." | |
rm ~/.config/git_meld_diff.sh | |
touch ~/.config/git_meld_diff.sh | |
echo "#!/bin/bash" >> ~/.config/git_meld_diff.sh |