Skip to content

Instantly share code, notes, and snippets.

View Villanuevand's full-sized avatar
👋
Hola,

Andrés Villanueva Villanuevand

👋
Hola,
View GitHub Profile
@Villanuevand
Villanuevand / AgendaContactos.js
Last active October 7, 2021 22:50
Agenda de Contactos, un código realizado para practicar la modificación del DOM y Objectos en JS.
/*
Para hacer el script efectivo se deben tener las siguientes etiquetas en el archivo .html
<h1>Agenda de Contactos</h1>
<input type="button" id="agregar" value="Agregar Contacto">
*/
var d = document;
var abc = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
var memoria = new Array();
function Agenda () {
@Villanuevand
Villanuevand / sendMailToFormSubmit.js
Last active August 29, 2015 13:57
sendMailToFormSubmit es un pequeño script desarrollado utilizando GAS (Google App Script) para extender las funcionalidad de los formularios de Google. Envía un correo electrónico automáticamente cada vez que alguien responda el formulario.
function sendMailOnFormSubmit(e) {
var recipient = "tucorreo@mensajeria.com";
var copyTo = "othermail@mensajeria.com"
//Opciones del formulario.
var timeStamp = e.values[0];
var name = e.values[1];
var email = e.values[2];
var knowledge = e.values[3];
var languages = e.values[4];
@Villanuevand
Villanuevand / evitaEnter.js
Created April 3, 2014 18:12
Una pequeña función Js, para, como su nombre lo dice evitar se presione la tecla "Enter"
function evitarEnter(event) {
var event = (event) ? event : ((event) ? event : null);
var node = (event.target) ? event.target : ((event.srcElement) ? event.srcElement : null);
if ((event.keyCode == 13) && (node.type == "text")) {
alert('Enter Desactivado');
return false;
}
}
@Villanuevand
Villanuevand / fechaDescriptiva.js
Last active August 29, 2015 14:01
Pequeña funcion javascript para obtener un formato de fecha que comprenda el patrón: Miercoles 28 de Mayo del 2014. (día de la semana, día del mes, mes y año actual).
/**
* Pequeña funcion javascript para obtener un formato de fecha que comprenda el patrón:
* día de la semana, día del mes, mes y año actual.
* Ejemplo: Miercoles 28 de Mayo del 2014.
*
* This is a little javascript function to get the date with the follow pattern:
* day of the week, day of the month, month and currently year.
* Example: Wednsneday, May 28th of 2014.
*/
@Villanuevand
Villanuevand / get-members-info.js
Last active August 29, 2015 14:21
Snippet que obtiene información de los miembros de la comunidad en Google Groups.
/**
* Pequeño snippet para obtener direcciones de correo electrónico
* de miembros en Google Groups, desde la vista "Todos los Miembros".
*/
var c = document.getElementsByClassName('gdf-tableRow'),
members = [];
for(var i = 0; i< c.length; i++){
var o = {};
o.name = c[i].childNodes[1].textContent;
@Villanuevand
Villanuevand / getBancos.js
Last active August 29, 2015 14:23
Obtener toda la información del listado de bancos en https://www.asobanca.com.ve/site/home.php
/**
* Instrucciones de USO.
* - Ir a https://www.asobanca.com.ve/site/home.php.
* - Presionar F12 para abrir DevTools.
* - Abrir consola y pegar este script!
* - Presionar ENTER.
* - copiar resultado y utilizar para cosas geniales!
*/
var c = document.getElementsByClassName('awMenuComiteesLink'),
@Villanuevand
Villanuevand / getSiteCookie.js
Created June 19, 2015 14:33
Verifica que exista una Cookie activa, y dispara un evento al detectarla.
/*
Script.JS
Cookie
- Nombre: _CookieTMP_Homepage_
- Valor: homepage_active
Importante cambiar el valor de la variable 'homepage' para realizar el debugin
del script.
*/
@Villanuevand
Villanuevand / baseHtml5.sublime-snippet
Last active August 13, 2020 10:15
Snippet para Sublime - Estructura base HTML5
<snippet>
<content><![CDATA[
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>Angular Materia introducción</title>
<meta name="description" content="Título de la página.">
<meta name="author" content="Andrés Villanueva">
@Villanuevand
Villanuevand / readme.md
Created April 26, 2016 20:02 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@Villanuevand
Villanuevand / vanilla-not-jquery.js
Created May 4, 2016 19:28 — forked from TexRx/vanilla-not-jquery.js
Pure JS alternatives to common CSS class jQuery functions
function hasClass(elem, className) {
return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' ');
}
function addClass(elem, className) {
if (!hasClass(elem, className)) {
elem.className += ' ' + className;
}
}