Skip to content

Instantly share code, notes, and snippets.

🏠
Trabajando desde casa

Juan González F. dosjota

🏠
Trabajando desde casa
Block or report user

Report or block dosjota

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View postman_install.sh
#!/usr/bash
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Crear lanzador
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
Name=Postman
@dosjota
dosjota / gist:9666a7274b4036588b92987b84267245
Created Jun 6, 2018
Downgrade php 7.2 to 7.1 in Ubuntu 18.04 LTS
View gist:9666a7274b4036588b92987b84267245
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.1
sudo apt-get install php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-mbstring php7.1-mcrypt php7.1-zip php7.1-fpm php7.1-intl php7.1-simplexml
sudo a2dismod php7.2
sudo a2enmod php7.1
sudo service apache2 restart
sudo update-alternatives --set php /usr/bin/php7.1
sudo update-alternatives --set phar /usr/bin/phar7.1
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.1
@dosjota
dosjota / changeBranchName.sh
Created Mar 15, 2018
Cambia el Nombre de un Branch de forma Local y Remota
View changeBranchName.sh
#!/bin/sh
# Cambia el Nombre de un Branch de forma Local y Remota
echo "Nombre Rama Actual?"
read old_branch
echo "Nombre Nueva Rama?"
read new_branch
echo "Cambiaras la rama actual: $old_branch por $new_branch"
@dosjota
dosjota / conn.php
Created Sep 27, 2017
Conexion PostgreSQL
View conn.php
<?php
$dbconn = pg_connect("host=localhost port=5432 dbname=nombreBaseDeDatos user=postgres password=xxxxxxx");
$estado = pg_connection_status($dbconn);
echo ($estado === PGSQL_CONNECTION_OK) ? 'Estado de la conexión ok' : 'No se ha podido conectar' ;
echo '<br>';
$resultado = pg_query($dbconn, "SELECT nombre FROM usuario");
$resultadoQuery = (!$resultado) ? "Ops! Imposible Ejecutar Query" : "Query Ok..." ;
echo $resultadoQuery;
echo '<br>';
@dosjota
dosjota / test.js
Last active Nov 2, 2017 — forked from plataforma-co/test.js
Code Quality Test (Choose one of the files below)
View test.js
'use strict';
// This class is used for logins
class Login {
constructor(hash) {
this.sessions = [];
this.users = [];
this.passwords = [];
Object.keys(hash).map(user => this.registerUser(user, hash[user]))
}
@dosjota
dosjota / primos.py
Created Sep 18, 2017
60 números primos terminados en 7
View primos.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
numero = 0
lista = []
while len( lista ) <= 59:
numero += 1
validar = 0
if numero % 10 == 7:
@dosjota
dosjota / perm.js
Created Apr 20, 2017
Permutacion de Array List
View perm.js
var lista = [[1,3],['a'],[4,5]]
var perm = (array, prefix = '')=>{
if (!array.length) {
return prefix
}
let resultado = array[0].reduce((resultado, valor) => {
return resultado.concat(perm(array.slice(1), prefix + valor))
}, []);
return resultado
@dosjota
dosjota / Color Aleatorio
Created Jul 1, 2015
Genera un color en hexadecimal de forma aleatoria
View Color Aleatorio
var color = function() {
var hex = '0123456789ABCDEF',
color = '#';
for (i=0;i<6;i++){
color+=hex.charAt(parseInt(Math.floor(Math.random() * hex.length)));
}
return color;
}
View gist:86f8f65e8284d5dd9a1c
function validaCodigo (nuevoCodigo) {
var codigosExistentes = ['codigo', 'codigoDOS'];
for(i=0;i< codigosExistentes.length;i++) {
if(nuevoCodigo == codigosExistentes[i]){
valido = false;
console.log('codigo existe : ' + nuevoCodigo + ' ID: ' + i);
break;
}else{
valido = true
}
@dosjota
dosjota / gist:19c4905ce21562403078
Created May 5, 2015
db.personas.update( { identificador: '17026086' }, { $inc: { age : 1 } } );
View gist:19c4905ce21562403078
db.personas.update( { identificador: '14026086' }, { $inc: { age : 1 } } );
You can’t perform that action at this time.