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 | |
class utils{ | |
public static function geocode($address){ | |
// url encode the address | |
$address = urlencode($address); | |
// google map geocode api url | |
$url = "https://maps.googleapis.com/maps/api/geocode/json?address={$address}&key=thegooglemapskey"; |
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).on('submit','#nombre_form',function(event){ | |
event.preventDefault(); | |
$.ajax({ | |
url:"url", | |
method:"POST", | |
data:new FormData(this), | |
dataType:'JSON', | |
contentType: false, | |
cache: false, | |
processData: false, |
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
const ionApp = <HTMLElement>document.getElementsByTagName('ion-app')[0]; | |
const startScanner = () => { | |
scanSub = this.qrScanner.scan().subscribe((text: string) => { | |
console.log(text); | |
}); | |
this.qrScanner.show(); | |
ionApp.style.display = 'none'; | |
}); |
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
.idea | |
node_modules | |
atlassian-ide-plugin.xml |
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
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g, '');} | |
String.prototype.ltrim=function(){return this.replace(/^\s+/,'');}; | |
String.prototype.rtrim=function(){return this.replace(/\s+$/,'');}; | |
String.prototype.fulltrim=function(){return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g,'').replace(/\s+/g,' ');}; | |
Date.prototype.MMDDYYYY = function() { | |
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
var myApp = angular.module('myApp', []); | |
myApp.directive('googleplace', function() { | |
return { | |
require: 'ngModel', | |
link: function(scope, element, attrs, model) { | |
var options = { | |
types: [], | |
componentRestrictions: {} | |
}; |
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 upfiles(model, method, args, filement, backcall){ | |
var doc = eval(document.getElementById(filement)); | |
console.log(doc); | |
var docx = doc.files; | |
var formData = new FormData(); | |
var ins = doc.files.length; | |
for (var x = 0; x < ins; x++) { |
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 | |
/** | |
* simple method to encrypt or decrypt a plain text string | |
* initialization vector(IV) has to be the same when encrypting and decrypting | |
* | |
* @param string $action: can be 'encrypt' or 'decrypt' | |
* @param string $string: string to encrypt or decrypt | |
* | |
* @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
1.Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ): | |
dpkg-query -W -f='${binary:Package}\n' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e '^java-common' | xargs sudo apt-get -y remove | |
sudo apt-get -y autoremove | |
2.Purge config files (careful. This command removed libsgutils2-2 and virtualbox config files too): | |
dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge | |
3.Remove Java config and cache directory: | |
sudo bash -c 'ls -d /home/*/.java' | xargs sudo rm -rf |