Skip to content

Instantly share code, notes, and snippets.

@mmfilesi
mmfilesi / gist-list.html
Created March 16, 2016 06:10
web component (polymer) to show user gists (0.0.5)
<dom-module id="gist-list">
<template>
<style>
.fade-ajax-out {
transition:1s linear all;
opacity:0;
background-color: #fcffdf;
}
.fade-ajax-in {
@mmfilesi
mmfilesi / main
Created May 3, 2017 05:19
propiedades profundas seguras
/* Acceder a propiedades de forma segura. Leído en El abismo de null
https://elabismodenull.wordpress.com/2017/03/16/pequenos-trucos-para-mejorar-tu-javascript/
*/
const isObject = obj => obj && typeof obj === 'object';
const hasKey = (obj, key) => key in obj;
const Undefined = new Proxy({}, {
get: function(target, name){
return Undefined;
@mmfilesi
mmfilesi / index.html
Created March 30, 2017 22:26
vue - emit - on
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title>vue</title>
<script src="js/vendor/vue.js"></script>
</head>
<body>
@mmfilesi
mmfilesi / js-oo-01.html
Created January 11, 2016 11:33
javaScript orientado a objetos (1)
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
@mmfilesi
mmfilesi / index.html
Created March 20, 2017 19:16
vue js (2)
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title>vue</title>
<script src="js/vendor/vue.js"></script>
</head>
<body>
<div id="foo">
@mmfilesi
mmfilesi / index.html
Created March 16, 2017 11:26
vue js (1)
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title>vue</title>
<script src="js/vendor/vue.js"></script>
</head>
<body>
<!-- 1. bindings -->
@mmfilesi
mmfilesi / fruits-components.html
Created March 8, 2016 23:02
how combine polymer with handlebars
<dom-module id="fruit-component">
<template>
<p>color: {{color}}</p>
<button on-tap="setColor">set color in light dom</button>
</template>
<script>
Polymer({
is: 'fruit-component',
@mmfilesi
mmfilesi / index.html
Last active February 5, 2017 19:19
electron
<!doctype html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
@mmfilesi
mmfilesi / LifeCycle.jsx
Created October 5, 2016 19:36
react component lifecicle
import React from 'react';
/*
Los componentes react con estado(1) tienen tres grandes fases en su ciclo de vida:
Mounting: montaje
Mounted: ya está montado
Unmounting: cuando se desmonta
Cada fase tiene una serie de métodos asociados que nos pueden servir de punto de captura para hacer cosas. Los detallo en el propio componente.
1. Los stateless no tienen ciclo de vida.
@mmfilesi
mmfilesi / .babelrc
Created October 4, 2016 08:42
react, webpack configuration
{
"presets": ["es2015", "stage-1", "react"]
}