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
https://1drv.ms/p/s!AiYUbsW8-PRoiuFj0c8TxPdP1RxZDA?e=GYKFFO |
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
from django.db import models | |
""" | |
# As it is an Enum, the keys cannot be repeated, but the phone codes are repeated. One solution is to turn the Enum around and when it is displayed, make a map to change the order. | |
country_calling_code = models.CharField( | |
max_length=39, | |
choices=map(lambda x: (f"{x[1]}|{x[0]}", x[0]), ListOfCountryCallingCodes.choices), | |
verbose_name="Pais origen número de teléfono", | |
) |
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
def long_text(text: str, repeat: int) -> str: | |
if repeat > 0: | |
return "".join( | |
map( | |
lambda letter: letter * repeat | |
if letter in "aeiou" | |
else letter, | |
text, | |
) | |
) |
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.addEventListener('DOMContentLoaded', function () { | |
// Aquí tu código | |
}); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Drag and drop</title> | |
<style> | |
.ficha { | |
width: 100px; | |
height: 100px; | |
float: left; |
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
if(nom.value == null || nom.value.length == 0 || /^\s+$/.test(nom.value)) { | |
bError = true; | |
} |
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
//Comprobar que es un e-mail válido | |
var sExpr = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; | |
if(!sExpr.test(correo.value)) { | |
bError = true; | |
} |
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() { | |
$('a[href*=#]:not([href=#])').click(function() { | |
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { | |
var target = $(this.hash); | |
target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); | |
if (target.length) { | |
$('html,body').animate({ | |
scrollTop: target.offset().top | |
}, 1000); | |
return 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
<?php | |
/** | |
* Clase para utilizar la base de datos | |
* 1.1v | |
*/ | |
class DB { | |
//Variables | |
public static $DB_HOST = 'localhost'; |
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
<!doctype html> | |
<html lang="es"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Ejemplo de formulario con AJAX</title> | |
<style> | |
body { | |
font-size: 14px; | |
text-align: center; | |
} |
NewerOlder