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
[ | |
{ | |
"_id": "5e7e456a37eeb7f350f73f15", | |
"index": 0, | |
"nombre": "Deanna", | |
"paterno": "Castro", | |
"materno": "Luna" | |
}, | |
{ | |
"_id": "5e7e456a3fcde287f9cc65de", |
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
#!/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 |
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
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 |
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/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" |
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 | |
$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>'; |
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
'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])) | |
} |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
numero = 0 | |
lista = [] | |
while len( lista ) <= 59: | |
numero += 1 | |
validar = 0 | |
if numero % 10 == 7: |
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 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 |
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 color = function() { | |
var hex = '0123456789ABCDEF', | |
color = '#'; | |
for (i=0;i<6;i++){ | |
color+=hex.charAt(parseInt(Math.floor(Math.random() * hex.length))); | |
} | |
return color; | |
} |
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 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 | |
} |
NewerOlder