Skip to content

Instantly share code, notes, and snippets.

View brauliodiez's full-sized avatar

Braulio Diez brauliodiez

View GitHub Profile
@brauliodiez
brauliodiez / Readme.md
Last active March 10, 2020 16:35
Para poner un pin centrado en cada comunidad autónoma en una mapa de españa, esto es útil para poder usarlo con por ejemplo d3js

Comunidades autonomas - Marcadores centrados

Listado de latitud y longitud, marcadores centrados por cada comunidad autónoma (España).

Posibles utilidades: mapas que montes con d3js.

Ejemplo de uso: https://codesandbox.io/s/hopeful-ellis-rlczx

class Pedido {
constructor() {
this.descuento = 0.90;
this.venta = 100;
}
aplicaDescuento() {
debugger;
console.log(this.venta);
var self = this;
@brauliodiez
brauliodiez / swaggernotes.md
Last active January 4, 2019 12:13
Notes about swagger

Installing swagger globally

npm install -g swagger

Create a new swagger project

swagger project create 
@brauliodiez
brauliodiez / generators.md
Last active January 23, 2019 18:16
Notas del training de generadores (Español)

Conceptos básicos

En javascript cuando llamamos a una función esta se ejecuta de inicio a final.

function logger() {
console.log('Start');
console.log('End');
}
@brauliodiez
brauliodiez / PodsProposal.MD
Last active August 26, 2018 16:27
Pods proposal

Pods proposal

Draft Pods proposal for the Chat solution, topics to discuss:

  • Likely lobby and chat components should be in the same pods.
  • This would just to show how to isolate in pods (core will hold session-info reducer).

Option A)

├───common-app
@brauliodiez
brauliodiez / closure.js
Last active June 3, 2018 08:35
Closure sample
const calculateFinalPrice = function () {
const discount = 0.90;
// simulate ajax call
setTimeout(function() {
const total = 200;
const final = total * discount;
console.log(final)
}, 500);
}
@brauliodiez
brauliodiez / readme.md
Last active September 1, 2023 04:48
lodash/fp set and flow

lodash/fp - set / flow

In this gist we are going to learn about basic goodies that we get from the library lodash/fp (fp stands for functional programming, great for ensuring immutability).We'll learn just by doing (step by step guided sample + codepens).

We'll cover lodash set and flow functions

Steps

  • We'll use codepen as our playground, navigate to this page:
@brauliodiez
brauliodiez / readme.md
Last active June 4, 2017 09:17
Typescript, playing a bit with types

Start

For sure now you will have a lot of questions poping up into your head, about cases where typing has not to be strict.

We will continue using typescript playground.

Let's start diving into that.

Topics to cover:

@brauliodiez
brauliodiez / readme.md
Last active October 1, 2017 12:15
Very basic intro, typescript types

Typescript getting started

Let's get started with Typescript.

We will use Typescript online playground for this demos:

http://www.typescriptlang.org/play/

Steps

  • Let's start with something very basic, if we paste this code on codepen (javascript):
@brauliodiez
brauliodiez / readme.md
Last active April 15, 2018 07:02
Spread Operator simple samples

spread operator

The spread syntax allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) or multiple variables (for destructuring assignment) are expected.

steps

Copying an object but replacing some properties:

This one we will need bable to make it work