Skip to content

Instantly share code, notes, and snippets.

View HashRaygoza's full-sized avatar

David Raygoza Gómez HashRaygoza

View GitHub Profile
@HashRaygoza
HashRaygoza / resize.sh
Created February 11, 2018 00:39
Escalar imagenes con ImageMagick
mogrify -resize 50x50% *.jpg
@HashRaygoza
HashRaygoza / rss.xml
Created December 29, 2019 19:27
Ejemplo de un feed RSS
<?xml version="1.0" encoding="UTF-8"?>
<!-- Declaracion de RSS -->
<rss version="2.0">
<!-- Declaracion del canal -->
<channel>
<!-- Titulo del Canal -->
<title>rss-example</title>
<!-- Descripcion del Canal -->
<description>Ejemplo de un RSS hecho a mano</description>
<!-- Enlace al sitio del Feed RSS -->
@HashRaygoza
HashRaygoza / PrintiText.java
Created March 13, 2018 01:52
Como enviar un documento iText a la impresora SIN mandarlo a disco duro primero
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mx.hash.printitext;
import com.itextpdf.kernel.geom.PageSize;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfWriter;
@HashRaygoza
HashRaygoza / barrasiText.java
Created November 6, 2022 07:19
Generación de codigos de barras en iText 7
package com.mycompany.barrasitext;
import java.io.File;
import com.itextpdf.barcodes.Barcode128;
import com.itextpdf.barcodes.Barcode39;
import com.itextpdf.barcodes.BarcodeCodabar;
import com.itextpdf.barcodes.BarcodeEAN;
import com.itextpdf.barcodes.BarcodeInter25;
import com.itextpdf.barcodes.BarcodeMSI;
import com.itextpdf.barcodes.BarcodePostnet;
import { Dialogo } from "./dialogo.js";
document.addEventListener("DOMContentLoaded", function() {
console.log("Inicializando");
let dialogo = new Dialogo();
});
"use strict";
class Dialogo {
constructor() {
// Obtenemos los objetos relevantes del documento
this.overlay = document.getElementById("overlay");
this.btn = document.getElementById("botonDialogo");
this.span = document.getElementsByClassName("botonCerrar")[0];
// le asignamos a cada boton una funcion qie se llamara al presionar
.overlay {
display: none; /* Hidden by default */
position: fixed; /* Stay in place */
z-index: 1; /* Sit on top */
left: 0;
top: 0;
width: 100%; /* Full width */
height: 100%; /* Full height */
overflow: auto; /* Enable scroll if needed */
background-color: rgb(0, 0, 0); /* Fallback color */
<!-- Ese div cubre la pantalla con una capa translucida -->
<div id="overlay" class="overlay">
<!-- Contenido del dialogo -->
<div class="contenidoDialgo">
<!-- Titulo y boton para cerrar-->
<div class="tituloDialogo">
Titulo del Dialogo
<span class="botonCerrar">&times;</span>
</div>
@HashRaygoza
HashRaygoza / EventoPagina.java
Created November 11, 2021 05:11
Evento Pagina
package mx.hashsoft.itext7;
import com.itextpdf.kernel.events.Event;
import com.itextpdf.kernel.events.IEventHandler;
import com.itextpdf.kernel.events.PdfDocumentEvent;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfPage;
import com.itextpdf.kernel.pdf.canvas.PdfCanvas;
import com.itextpdf.layout.Canvas;
@HashRaygoza
HashRaygoza / iText7.java
Created November 11, 2021 05:10
clase principal del ejemplo iText 7
package mx.hashsoft.itext7;
import com.itextpdf.kernel.events.PdfDocumentEvent;
import com.itextpdf.kernel.geom.PageSize;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Paragraph;
import java.io.FileNotFoundException;
import java.util.logging.Level;