Skip to content

Instantly share code, notes, and snippets.

View talcual's full-sized avatar
💭
Magic Code

Luis Toscano talcual

💭
Magic Code
View GitHub Profile
<?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";
$(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,
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';
});
@talcual
talcual / .gitignore
Created August 20, 2019 03:15 — forked from fkowal/.gitignore
NodeJs tail with websocket
.idea
node_modules
atlassian-ide-plugin.xml
@talcual
talcual / import_orders_from_amazon.js
Created August 5, 2019 02:58 — forked from maxpaynestory/import_orders_from_amazon.js
Scrape Amazon Seller central orders using casperjs and phantomjs
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() {
@talcual
talcual / app.js
Created August 1, 2019 08:05 — forked from victorb/app.js
Easy AngularJS Directive for Google Places Autocomplete
var myApp = angular.module('myApp', []);
myApp.directive('googleplace', function() {
return {
require: 'ngModel',
link: function(scope, element, attrs, model) {
var options = {
types: [],
componentRestrictions: {}
};
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++) {
CSS
.redes{
position: fixed;
left: 0px;
z-index: 1000000000000000;
top: 25%; /*aqui se varia la posicion vertical segun la cantidad de iconos de redes.*/
}
@talcual
talcual / openssl_encrypt_decrypt.php
Created December 5, 2018 07:31 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?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
*/
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