Skip to content

Instantly share code, notes, and snippets.

View parzibyte's full-sized avatar
💻
Coding

Parzibyte parzibyte

💻
Coding
View GitHub Profile
/**
* Árboles binarios en C
* Operaciones de:
* Inserción
* Recorrido inorden, postorden y preorden
* Uso de malloc
*
* @author parzibyte
* @see https://parzibyte.me/blog
* */
const imprimirQr = async (nombreImpresora) => {
const contenido = "Soy el contenido de un QR. Visita parzibyte.me";
if (!contenido) {
return alert("Escribe el contenido del QR");
}
const conector = new ConectorPluginV3(URLPlugin);
conector.Iniciar();
conector.EscribirTexto("Veamos un QR:");
conector.Feed(1);
conector.ImprimirCodigoQr(contenido, 160, 2, ConectorPluginV3.TAMAÑO_IMAGEN_NORMAL);
@parzibyte
parzibyte / script.js
Last active July 5, 2023 01:37
Print ticket in thermal printer by using only client-side JavaScript and plugin - https://parzibyte.me/blog/en/2019/10/13/a-plugin-for-printing-thermal-printers-from-browser/
const demostrarCapacidades = async (nombreImpresora) => {
const conector = new ConectorPluginV3(null, "license here");
const respuesta = await conector
.Iniciar()
.DeshabilitarElModoDeCaracteresChinos()
.EstablecerAlineacion(ConectorPluginV3.ALINEACION_CENTRO)
.DescargarImagenDeInternetEImprimir("http://assets.stickpng.com/thumbs/587e32259686194a55adab73.png", 0, 216)
.Feed(1)
.EscribirTexto("Parzibyte's blog\n")
.EscribirTexto("Blog de un programador\n")
class Operacion {
constructor(nombre, argumentos) {
this.nombre = nombre;
this.argumentos = argumentos;
}
}
const edadDelUsuario = parseInt(prompt("¿Cuál es tu edad?"));
if (edadDelUsuario >= 18) {
alert("Eres mayor de edad");
} else {
alert("Eres menor de edad");
}
/*
____ _____ _ _ _
| _ \ | __ \ (_) | | |
| |_) |_ _ | |__) |_ _ _ __ _____| |__ _ _| |_ ___
| _ <| | | | | ___/ _` | '__|_ / | '_ \| | | | __/ _ \
| |_) | |_| | | | | (_| | | / /| | |_) | |_| | || __/
|____/ \__, | |_| \__,_|_| /___|_|_.__/ \__, |\__\___|
__/ | __/ |
|___/ |___/
<?php
include_once "vendor/autoload.php";
use PHPMailer\PHPMailer\PHPMailer;
$phpMailer = new PHPMailer;
# Puede ser ruta relativa o absoluta
$nombreDelDocumento = "factura.pdf";
String obtenerInterfaz()
{
String HtmlRespuesta = "<!DOCTYPE html>"
"<html lang='en'>"
"<head>"
"<meta charset='UTF-8'>"
"<meta name='viewport' content='width=device-width, initial-scale=1.0'>"
"<title>LEDS by parzibyte</title>"
"</head>"
"<body>";
/**
* Producto de matrices en C
*
* @author parzibyte
* @see https://parzibyte.me/blog
* */
#include <stdio.h>
#define FILAS_MATRIZ_B 3
#define COLUMNAS_MATRIZ_B 2
long fibonacci(long posicion, int imprimir) {
long siguiente = 1, actual = 0, temporal = 0;
for (long x = 1; x <= posicion; x++) {
if (imprimir)
printf("%ld, ", actual);
temporal = actual;
actual = siguiente;
siguiente = siguiente + temporal;
}
if (imprimir)