Skip to content

Instantly share code, notes, and snippets.

View joalbertg's full-sized avatar
🎯
Focusing

Joalbert Andrés González joalbertg

🎯
Focusing
View GitHub Profile
Object
Exception
NoMemoryError
ScriptError
LoadError
NotImplementedError
SyntaxError
SignalException
Interrupt
StandardError
@joalbertg
joalbertg / index.html
Created April 29, 2017 12:23
Mixin para video responsive - sass
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Video responsive</title>
<link rel="stylesheet" type="text/css" href="css/ratio.css">
</head>
<body>
<div class="video">
<iframe width="560" height="315" src="https://www.youtube.com/embed/PRV_0NAK9SI" frameborder="0" allowfullscreen></iframe>
@joalbertg
joalbertg / index.html
Created May 3, 2017 13:50
Diseño de form para login
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Form login</title>
<link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body>
<div class="content">
<h1>Login to site</h1>
@joalbertg
joalbertg / index.html
Created May 7, 2017 03:16
Barra de imagenes con flex y transform
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Transform</title>
<link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body>
<div class="container">
<div class="skew"><img src="http://lorempixel.com/500/250"></div>
@joalbertg
joalbertg / How to use Images as Radio buttons.md
Created May 22, 2017 14:00 — forked from rcotrina94/How to use Images as Radio buttons.md
How to use images for radio buttons (input-radio).
@joalbertg
joalbertg / writing.js
Last active November 16, 2017 19:34
Uso del setInterval y clearInterval
/* escribe un párrafo con un efecto de máquina de escribir
** usando setInterval(callback, time)
** parámetro str una cadena de texto
*/
var writing = function(str) {
// array de todos los carácteres del string
// ej. str = 'Hola';
// str.split(''); genera un array ['H', 'o', 'l', 'a']
var arrFromStr = str.split('');
@joalbertg
joalbertg / countDown.js
Last active November 16, 2017 20:14
Escribiendo con efecto máquina
/* contador regresivo
** parametro ms númerico, representa milisegundos
*/
var countDown = function (ms) {
// referencia al método setInterval(callback, time)
var myCountDown = setInterval(function () {
// variables para minutos y para segundos
var minutes = Math.floor(ms / (1000 * 60)),
seconds = Math.floor((ms % (1000 * 60)) / 1000);
@joalbertg
joalbertg / web-servers.md
Created January 3, 2018 20:00 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@joalbertg
joalbertg / nodelist-iteration.js
Created February 6, 2018 15:38
Iterar un nodeList
let elements = document.querySelectorAll('div'),
callback = (el) => { console.log(el); };
// Spread operator
[...elements].forEach(callback);
// Array.from()
Array.from(elements).forEach(callback);
// for...of statement
@joalbertg
joalbertg / attr_custom.rb
Last active August 10, 2020 17:36
ruby: Metaprogramming
# https://medium.com/@hackvan/entendiendo-la-metaprogramaci%C3%B3n-con-ruby-7a0360ee67e7
=begin
# Class implementa algunos interesantes métodos de introspección como:
class # Retorna el objeto de clase a la que pertenece el objeto instanciado
superclass # Retorna el objeto de clase del cual hereda la clase del objeto instanciado
ancestors # Retorna un Array con el listado de la cadena de ancestros
instance_variables # Retorna un Array con el listado de las variables de instancia creadas
# en la clase del objeto.