Skip to content

Instantly share code, notes, and snippets.

View JoseJPR's full-sized avatar
:octocat:
Developing with JavaScript

José J. Pérez Rivas JoseJPR

:octocat:
Developing with JavaScript
View GitHub Profile
@JoseJPR
JoseJPR / rxjs-custom-observable-and-operators.js
Last active September 19, 2021 06:57
🏗️ How to create Custom Observable and Operators with RxJS and Node.js. 👀 With this example I want to show how you can generate custom Observables and Operators with RxJS and Node.js.
/**
* Title: How to create Custom Observable and Operators with RxJS and Node.js.
*
* Description: With this example I want to show how you can generate custom
* Observables and Operators with RxJS and Node.js.
*/
import { Observable } from 'rxjs';
import { request } from 'undici';
@JoseJPR
JoseJPR / tool-url-normalize.js
Last active September 16, 2021 11:18
Normalize strings in order to create pretty url. If you have to generate beautiful urls from strings in which certain characters or html elements may exist, this is your tool.
/**
* Title: Normalize strings in order to create pretty url.
*
* Description: If you have to generate beautiful urls from strings
* in which certain characters or html elements may exist, this is your tool.
*/
const urlNormalize = (str) => {
const from = Array.from('ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛãàáäâèéëêìíïîòóöôùúüûÑñÇç');
const to = Array.from('AAAAAEEEEIIIIOOOOUUUUaaaaaeeeeiiiioooouuuunncc');
@JoseJPR
JoseJPR / closure-with-function-as-parameter.js
Created June 29, 2020 08:10
JavaScript Closures with Functions as Parameters. In this example you can see that work with closure. You can define a function and execute when pass the rules of the other function. In this example you can create a vehicle if the road previously exist.
/**
* Title: JavaScript Closures with Function as Parameter.
*
* Description: In this example you can see that work with closure. You can define
* a function and execute when pass the rules of the other function.
* In this example you can create a vehicle if the road previously exist.
*
* More Info: https://developer.mozilla.org/es/docs/Web/JavaScript/Closures
*/
@JoseJPR
JoseJPR / closure-with-properties-and-variables.js
Last active June 29, 2020 07:52
JavaScript Closure with Properties and Variables. In this example you can see that work with closure you can define properties or variables after use it.
/**
* Title: JavaScript Closure with Properties and Variables.
*
* Description: In this example you can see that work with closure you can define
* properties or variables after use it.
*
* More Info: https://developer.mozilla.org/es/docs/Web/JavaScript/Closures
*/
// Define Anonymous Function for encapsulate from Root Scope.