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 | |
/** | |
* Bcrypt hashing class | |
* | |
* @author Thiago Belem <[email protected]> | |
* @link https://gist.github.com/3438461 | |
*/ | |
class Bcrypt { |
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
[ | |
{ "keys": ["ctrl+shift+d"], "command": "find_under_expand" }, | |
{ "keys": ["ctrl+d"], "command": "duplicate_line" }, | |
{ "keys": ["ctrl+alt+c"], "command": "toggle_comment", "args": { "block": false } }, | |
{ "keys": ["ctrl+shift+c"], "command": "color_pick" }, | |
{ "keys": ["ctrl+up", "ctrl+up"], "command": "ftp_sync_current" }, | |
{ "keys": ["ctrl+down", "ctrl+down"], "command": "ftp_sync_down_current" }, | |
{ | |
"keys": ["ctrl+alt+j"], "command": "js_format", | |
"context": [{"key": "selector", "operator": "equal", "operand": "source.js,source.json"}] |
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 |
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
<?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
// 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
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
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
<?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
/* | |
* 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], |
OlderNewer