Skip to content

Instantly share code, notes, and snippets.

View johnsi15's full-sized avatar
🤖
Web technology lover 👨‍💻

John Serrano johnsi15

🤖
Web technology lover 👨‍💻
View GitHub Profile
@johnsi15
johnsi15 / mysqli
Last active June 17, 2016 15:35
Este código realiza una conexión a una base de datos sqli con php
<?php
$bd = new mysqli("localhost","root","andrey15","agenda");
if($bd->connect_errno){
echo "Error en la conexion..";
}else{
echo "Conexion exitosa...<br>";
echo $bd->host_info;
}
/* //para registrar datos....
@johnsi15
johnsi15 / Comandos git
Created June 18, 2016 14:56
Comandos básicos de git
git add .
git commit -m "comentario"
//El git pull para bajar cambios
git pull origin master
------------------------------
//El git push para enviar
git push origin master
# -*- coding: utf-8 -*-
print "area del rectangulo"
b = int(raw_input("base"))
h = int(raw_input("altura"))
c = b * h
# -*- coding: utf-8 -*-
print "la suma de dos numeros"
a = int(raw_input("numero"))
b = int(raw_input("numero"))
c = a + b
print "la suma es %s" % c
# -*- coding: utf-8 -*-
print "volumen del cubo"
t = int(raw_input("arista:"))
a = 6 * (t)**2
print "el volumen es %s" % a
# -*- coding: utf-8 -*-
print "area del circulo"
r = int(raw_input("radio"))
a = 3.14*(r)**2
print "El area del circulo es %f " % a
# Lista de comandos usados en #PlatziTerm
_Work in progress_
## Conceptos
- **PROMPT**: Donde se encuentra el cursor, un lugar en el árbol de nodos que es la representación del disco duro en el sistema operativo
## Comandos (y algunas banderas)
- `ls`: lista los contenidos de un directorio
@johnsi15
johnsi15 / Table Html5
Created February 21, 2017 14:16
Estructura de tables en html5
<table id="tableRegistros" style="display: none;">
<thead>
<tr>
<th>Código</th>
<th>Dirección</th>
<th>Tipo de suscripción</th>
<th>Deuda total</th>
<th>N° de atrasos</th>
</tr>
</thead>
@johnsi15
johnsi15 / Funciones JavaScript
Last active July 1, 2017 03:30
Formas de crear funciones en JavaScript
let base = 5;
let height = 10;
// Escapando concatenacion con comillas nueva formas de concatenar contenido
// console.log(`Hola mundo ${base * height / 2}`);
// Funcion normal Forma #1
// function areaTriangulo(base, height){
// return base * height / 2;
// }
@johnsi15
johnsi15 / Variables let y var
Last active June 16, 2017 15:55
Ejemplo del ámbito de las variables let y var
function varTest() {
var x = 31;
if (true) {
var x = 71; // misma variable!
console.log(x); // 71
}
console.log(x); // 71
}
function letTest() {