Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
var hash = require('hash.js')
//Returns a hash from a string (used to generate result item ids)
function getHash(value) {
return hash.sha256().update(value).digest('hex')
}
//Id for videos:
this.id = getHash(data.videoId + data.channelTitle)
{
"term": "moon",
"resultId": "b49f8a710fe0e38edbd5e4330695e44eab3abd297b28a8ad04d2be295962caed",
"gold": true,
"data": {
"resultId": "b49f8a710fe0e38edbd5e4330695e44eab3abd297b28a8ad04d2be295962caed",
"position": 10,
"resultType": "Short Videos",
"whitelist": true,
"twitter": false,
@hugozap
hugozap / asignación.js
Last active March 31, 2017 21:19
taller-principiantes-snippets
//Asignación de valores a variables
var cantidad = 10
var nombre = "Dean"
var fecha = new Date()
var persona = {
nombre: "Sarah",
edad:35
};

Data Binding System in Polymer.

El sistema de data binding permite que los datos y los controles estén sincronizados. Cuando el usuario interactúa con un control (e.g input ) estos cambios son reflejados en el modelo que se encuentra asociado.

Conceptos básicos del databinding.

  • Modelo ( objeto que contiene los datos )
  • UI ( Controles que pueden mostrar/editar )
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import 'aframe';
import {Scene, Entity, Sky} from 'aframe-react'
import {Motion,spring} from 'react-motion';
class App extends Component {
constructor(props) {
f(...)
{
vale = null
steps = [
{
condition:ALPHA,
func: ()=>{foxtrot()}
},
{
condition:!ALPHA,
/* Concepto de animación FLIP
Esto es apenas un prototipo no optimizado (usa restyle)
sirve para hacer animar las propiedades de caja top, left, width, height
pero convirtiendolas en transforms que son muchísimo más rápidas
https://gist.github.com/hugozap/5a3bb46902fa5483df14d880f34f7d5d
*/
var domready = require('dom-ready')
var root = document.body
var restyle = require('restyle')
var markup = `
var rpartition = require('./regionPartition.js')
var Canvas = require('canvas-browserify')
var html = require('yo-yo')
var w = 800
var h = 800
var canvas = new Canvas(w, h)
var ctx = canvas.getContext('2d')
var state = {

Aplicaciones distribuidas descentralizadas con JavaScript

@hugozap

Motivación

  • Open Web
  • Independencia de servicios y gatekeepers.
  • Revivir el espíritu creativo de la web.