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
const imprimirQr = async (nombreImpresora) => { | |
const contenido = $qr.value; | |
if (!contenido) { | |
return alert("Escribe el contenido del QR"); | |
} | |
const conector = new ConectorPluginV3(URLPlugin); | |
conector.Iniciar(); | |
conector.ImprimirCodigoQr(contenido, 160, 2, ConectorPluginV3.TAMAÑO_IMAGEN_NORMAL); | |
conector.Iniciar(); //Nota: esto solo es necesario en ocasiones, por ejemplo en mi impresora debo hacerlo siempre que acabo de imprimir una imagen | |
conector.Feed(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
const conector = new ConectorPluginV3(URLPlugin); | |
conector.Iniciar(); | |
conector.EscribirTexto("Hola mundo\nParzibyte.me"); | |
conector.Feed(1); | |
const respuesta = await conector | |
.imprimirEn(nombreImpresora); | |
if (respuesta === true) { | |
alert("Impreso correctamente"); | |
} else { | |
alert("Error: " + respuesta); |
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 PyPDF2 import PdfFileMerger | |
pdfs = ["PdfFileWriter.pdf", "RectangleObject.pdf"] | |
nombre_archivo_salida = "salida.pdf" | |
fusionador = PdfFileMerger() | |
for pdf in pdfs: | |
fusionador.append(open(pdf, 'rb')) | |
with open(nombre_archivo_salida, 'wb') as salida: |
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
Scanner sc = new Scanner(System.in); | |
int numero, multiplo; | |
System.out.println("Ingresa un número: "); | |
numero = sc.nextInt(); | |
System.out.println("Ingresa un múltiplo: "); | |
multiplo = sc.nextInt(); | |
if (numero % multiplo == 0) { | |
System.out.printf("%d es múltiplo de %d", numero, multiplo); | |
} else { | |
System.out.println("No es múltiplo"); |
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
#include <stdio.h> | |
#include <string.h> | |
int main(){ | |
char cadena[] = "Hola,mundo", | |
delimitador[] = ","; | |
char *token = strtok(cadena, delimitador); | |
if(token != NULL){ | |
printf("Encontramos un token: %s", token); | |
} |
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
int main(void) { | |
int numero = 10, posibleMultiplo = 2; | |
// Comprobar | |
int resultado = esMultiplo(numero, posibleMultiplo); | |
if (resultado) { | |
printf("%d es multiplo de %d", numero, posibleMultiplo); | |
} else { | |
printf("%d NO es multiplo de %d", numero, posibleMultiplo); | |
} | |
} |
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
Swal | |
.fire({ | |
title: "Tu nombre", | |
input: "text", | |
showCancelButton: true, | |
confirmButtonText: "Guardar", | |
cancelButtonText: "Cancelar", | |
}) | |
.then(resultado => { | |
if (resultado.value) { |
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
<!-- | |
El atributo enctype es importante, si no, no nos permitirá subir el archivo | |
--> | |
<form action="procesar.php" method="post" enctype="multipart/form-data"> | |
<input type="file" name="archivo"> | |
<br><br> | |
<input type="submit" value="Enviar"> | |
</form> |
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
private static void burbuja(int[] arreglo) { | |
for (int x = 0; x < arreglo.length; x++) { | |
// Aquí "y" se detiene antes de llegar | |
// a length - 1 porque dentro del for, accedemos | |
// al siguiente elemento con el índice actual + 1 | |
for (int y = 0; y < arreglo.length - 1; y++) { | |
int elementoActual = arreglo[y], | |
elementoSiguiente = arreglo[y + 1]; | |
if (elementoActual > elementoSiguiente) { | |
// Intercambiar |
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 | |
include_once "./vendor/autoload.php"; | |
use Dompdf\Dompdf; | |
$dompdf = new Dompdf(); | |
$dompdf->loadHtml('<h1>Hola mundo</h1><br><a href="https://parzibyte.me/blog">By Parzibyte</a>'); | |
$dompdf->render(); | |
$contenido = $dompdf->output(); | |
$nombreDelDocumento = "1_hola.pdf"; | |
$bytes = file_put_contents($nombreDelDocumento, $contenido); |