Skip to content

Instantly share code, notes, and snippets.

View alvaramz's full-sized avatar

Adrián Alvarado Ramírez alvaramz

View GitHub Profile
@alvaramz
alvaramz / EjemplosJUnit.md
Created April 16, 2021 20:47
Ejemplos de JUnit test

Ejemplo para invocar un método privado denominado obtenerEntradaArchivo en una clase denominada Compresor:

... Method metodo = Compresor.class.getDeclaredMethod("obtenerEntradaArchivo", String.class, String.class); metodo.setAccessible(true);

Compresor instance = new Compresor();
ZipEntry result = (ZipEntry)metodo.invoke(instance, rutaArchivoZip, rutaEntrada);

assertNotNull(result); ....

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
@alvaramz
alvaramz / skeleton.sh
Created May 28, 2019 16:26
Debian default skeleton init.d script
#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
@alvaramz
alvaramz / _service.md
Created May 27, 2019 21:49 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@alvaramz
alvaramz / _service.md
Created May 27, 2019 21:49 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@alvaramz
alvaramz / models.java
Created September 19, 2018 17:45 — forked from leefsmp/models.java
Basic RESTful API from a Java servlet
package com.autodesk.adn.viewanddata;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Collection;
import java.util.HashMap;
import java.util.UUID;
import javax.servlet.ServletException;
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Operadores en JS</title>
</head>
<body>
<p>Para ver los resultados, abrir la consola con F12</p>
@alvaramz
alvaramz / almacenamiento_local_js.html
Created May 30, 2018 16:45
Un ejemplo de uso de localStorage (almacenamiento en el navegador).
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ejemplo de almacenamiento local en JS.</title>
</head>
<body>
<h1>Prueba de uso de almacenamiento local en el navegador (Web storage).</h1>
@alvaramz
alvaramz / ejemplo_basico_js.html
Created May 30, 2018 15:55
Un ejemplo re contra básico de js. Como para repasar.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Documento de prueba javascript</title>
</head>
<body>
<script>
// Esto es un ejemplo de un comentario de una línea.