This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="flatmap function with reduce functional programming"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>RxJS 5 Operators</title> | |
<script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.3/dist/global/Rx.umd.js"></script> | |
</head> | |
<body> | |
<input type="text" id="example" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Code examples from the article: S.O.L.I.D The first 5 priciples of Object Oriented Design with JavaScript | |
https://medium.com/@cramirez92/s-o-l-i-d-the-first-5-priciples-of-object-oriented-design-with-javascript-790f6ac9b9fa#.7uj4n7rsa | |
*/ | |
const shapeInterface = (state) => ({ | |
type: 'shapeInterface', | |
area: () => state.area(state) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const counter = (state = 0, action) => { | |
switch(action.type){ | |
case 'INCREMENT': | |
return state + 1; | |
case 'DECREMENT': | |
return state - 1; | |
default: | |
return state; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crocks = require('crocks'); | |
const { and, compose, isEmpty, isString, Maybe, not, prop, safe } = crocks; | |
const { join, split, toLower } = require('ramda'); | |
const isNonEmptyString = and(not(isEmpty), isString); | |
const createUrlSlug = compose(join('-'), split(' '), toLower); | |
const createUrl = slug => `localhost:3000/${slug}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="root"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Vehicle { | |
protected speed: number; | |
protected cubicCapacity: any; | |
constructor(speed: number, cubicCapacity: number){ | |
this.speed = speed; | |
this.cubicCapacity = cubicCapacity; | |
} | |
public getSpeed(): number { | |
return this.speed; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let random = function*() { | |
while(true) { | |
console.log("make random") | |
yield Math.random(); | |
} | |
} | |
let filter = function*(items, predicate) { | |
for(let item of items){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const data = [ | |
{ from: 'Holman Serrano', priority: 'normal', subject: 'Payment due' }, | |
{ from: 'Holman Serrano', priority: 'high', subject: 'Payment due' }, | |
{ from: 'Barbra Rasmussen', priority: 'low', subject: 'Payment due' }, | |
{ from: 'Anastasia Cherry', priority: 'high', subject: 'Payment due' }, | |
{ from: 'Holman Serrano', priority: 'high', subject: 'Weekend BBQ' }, | |
{ from: 'Baird Montoya', priority: 'low', subject: 'Weekend BBQ' }, | |
{ from: 'Flores Aguilar', priority: 'low', subject: 'Payment due' } | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin e($elements...) { | |
$selector: (); | |
@each $element in $elements { | |
$selector: append($selector, unquote("&__" + $element), comma); | |
} | |
#{$selector} { | |
@content; | |
} |
OlderNewer