Skip to content

Instantly share code, notes, and snippets.

My weekly steps for updating Node.js and related tools

A. Node.js (via nvm in Windows)

1. Install latest LTS/Current Node version

> nvm list                //To check installed versions
> nvm install 14.14.0     //Replace by the version you want to install
> nvm use 14.14.0
> nvm uninstall 14.13.1   //Clean if you need to

2. General check and safe update npm packages

@jomasero
jomasero / textareaDinamico.html
Created July 14, 2014 00:06
Textarea de agregación dinámica.
<!DOCTYPE html>
<html>
<head>
<title>TextArea dinamico</title>
<style>
#seccionObservaciones
{
margin: 5px;
border: 1px solid #ddd;
padding: 5px;
@jomasero
jomasero / jQueryUIHTabs.html
Created July 14, 2014 00:04
Horizontal jQueryUI Tabs
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Tabs - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
@jomasero
jomasero / tooltip-css.html
Created July 13, 2014 00:06
Tooltip fácil con CSS.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Tooltip con CSS</title>
<style type="text/css">
body{ font:13px Arial, sans-serif; color:#999999; background:#023c4b;}
img{border:none;}
a{font:15px Geneva, Arial, Helvetica, sans-serif; color:#CCCCCC; text-decoration:none;}
a:hover{border-bottom: 1px dashed #CCCCCC;}
@jomasero
jomasero / fifoCircular.c
Created July 6, 2014 22:34
FIFO circular de enteros en C
/* Very simple queue
* These are FIFO queues which discard the new data when full.
*
* Queue is empty when in == out.
* If in != out, then
* - items are placed into in before incrementing in
* - items are removed from out before incrementing out
* Queue is full when in == (out-1 + QUEUE_SIZE) % QUEUE_SIZE;
*
* The queue will hold QUEUE_ELEMENTS number of items before the
@jomasero
jomasero / eventoPersonal.js
Created June 25, 2014 19:18
Eventos personalizados con jQuery.
function holaEvento(datosE) {
alert("Número = " + datosE.numero + ", palabra: " + datosE.palabra);
}
$(document).on("nombreEvento", function(evento) {
holaEvento(evento.datosEvento);
});
$.event.trigger({
type: "nombreEvento",
@jomasero
jomasero / logs_servidores.sh
Created June 24, 2014 20:54
Comandos útiles para manejo de logs de servidores dotLRN, PHP y Postgres.
# Log de apache-PHP:
tail -f /var/log/apache2/error.log
# Log de dotlrn:
tail -f /usr/share/dotlrn/log/error.log
# Para agregar IP confiable a Postgree:
pico /etc/postgresql/8.4/main/pg_hba.conf
# ...
/etc/init.d/postgresql reload
@jomasero
jomasero / dataBaseJAVA.java
Created February 6, 2014 19:08
Abrir una conexión a base de datos en JAVA.
import java.sql.*;
Connection connection = null;
String driver = "org.apache.derby.jdbc.EmbeddedDriver";
String connectionURL = "jdbc:derby:"
connectionURL += my_db_path;
try {
// load driver
@jomasero
jomasero / formatFechas.js
Created January 29, 2014 23:42
Funciones para el formato de fechas en JS.
///*** TDCVUtilFechas: Namespace con funciones de formato de fechas y tiempo. ***///
var TDCVUtilFechas = {};
/** Devuelve un string con el formato preferido para fechas en español. */
TDCVUtilFechas.prettyFormat = function(dateString) {
var DIAS_SEMANA = ["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"];
var MESES = ["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];
var dateObject = (dateString === "") ? new Date() : new Date(dateString);
@jomasero
jomasero / timePHP.php
Created July 30, 2013 21:40
Formatear fechas UNIX
<?php
date_default_timezone_set('America/Costa_Rica');
$todayDate = time();
$hoy = date("Y-m-d\TH:i:s\Z", $todayDate);
$deadLine = date("Y-m-d\TH:i:s\Z", 347883748);
echo '<p style="color: red">Ahora: '. $hoy .'<br />Deadline: ' .$deadLine . '</p>';
if ($todayDate > $fechaLimite) echo '<p style="color: green">Yahoooo!!!</p>';