Skip to content

Instantly share code, notes, and snippets.

View GersonLazaro's full-sized avatar

Gerson Lázaro GersonLazaro

View GitHub Profile
@GersonLazaro
GersonLazaro / index.html
Last active December 28, 2015 18:45
Efecto Ripple de Material Design de manera simple
<button class="btn btn-circle">
<div class="ripple-container">
<span class="ripple-effect"></span>
</div>
+
</button>
<button class="btn btn-rectangle btn-raised">
<div class="ripple-container">
<span class="ripple-effect"></span>
</div>
@GersonLazaro
GersonLazaro / styles.css
Last active December 28, 2015 20:43
Estilos para el efecto ripple
button{
outline: 0px;
}
.btn{
border: none; /*Quita los bordes asperos que tienen los botones por defecto*/
background-color: #2196F3;
margin: .5rem;
position: relative;
transform: rotateZ(360deg);
transition: all .2s ease;
.ripple-container {
/*Con los siguientes valores de position, top, left, width y height aseguramos que el div tome todo el tamaño de su padre*/
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
background: transparent;
}
@GersonLazaro
GersonLazaro / ripple.js
Last active December 28, 2015 20:49
Efecto ripple en javascript sin jquery
var ripple = document.querySelectorAll('.ripple-container');
/*Guardamos un array con todos los botones. Para compatibilidad con navegadores
antiguos puedes reemplazar el querySelectorAll con un getElementsByClassName*/
[].forEach.call(ripple, function(e) {
e.addEventListener('click', function(e) {
/*Esto se activará cada vez que haya un click en un botón*/
var offset = this.parentNode.getBoundingClientRect();
//Toma los limites del padre (el padre es el <button> para
//los botones, o el <div> principal en la imagen
var effect = this.querySelector('.ripple-effect');
@GersonLazaro
GersonLazaro / index.html
Last active November 13, 2022 11:24
Efecto Ripple - Material Design
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Efecto Ripple - Material Design</title>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<div class="container">
@GersonLazaro
GersonLazaro / Cambio de moneda
Last active April 6, 2017 14:10
Programación Dinámica
private static int N = 5, V;
private static int[] coinValue = new int[] {1, 5, 10, 25, 50};
private static int[][] memo = new int[6][7500];
private static int ways(int type, int value) {
if (value == 0) {
return 1;
}
}
1
1 2 1 2 1
3 5 3 4 3
4 2 1 2 1
2
3 1 4 2 1 2 1
4 2 5 3 6 5 4
1 3 1 4 2 3 1
2 4 2 3 1 4 2
1 3 1 5 2 3 1
1 30
2 19
3 696
4 39
5 58
6 33
7 55
8 1
9 5
10 198
1 2 2 1 0
2 11 16 8 4
3 44 92 50 24
4 189 512 284 144
5 798 2654 1499 776
6 3383 13344 7620 4004
7 14328 65368 37636 19984
8 60697 314432 182152 97472
9 257114 1490842 867829 467184
10 1089155 6988464 4083824 2208996
1 14093/99532
2 16/113
3 1/7
4 563775/599324
5 74678/135649
6 594925/755304
7 228407/240744
8 530597/774977
9 306441/319652
10 397881/411826