<type>[optional scope]: <description>
[optional body]
[optional footer]
This file contains hidden or 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
import parse from "html-react-parser"; | |
import DOMPurify from "dompurify"; | |
export default function parseHtml(response) { | |
if (response) { | |
const dirty = response; | |
const clean = DOMPurify.sanitize(dirty); | |
return parse(clean); | |
} | |
} |
This file contains hidden or 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
{ | |
"currency":"EUR", | |
"deals":[ | |
{ | |
"transport":"train", | |
"departure":"London", | |
"arrival":"Amsterdam", | |
"duration":{ | |
"h":"05", | |
"m":"00" |
This file contains hidden or 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 curry = function (tocurry) { | |
const params = Array.prototype.slice.call(arguments, 1); | |
return function () { | |
return tocurry.apply(this, params.concat( | |
Array.prototype.slice.call(arguments, 0) | |
)); | |
}; | |
}; |
This file contains hidden or 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
/** Minimalist Priority Queue. */ | |
export default class PriorityQueue { | |
constructor() { | |
this.nodes = []; | |
} | |
/** | |
* Enqueue a new element to the Queue | |
* @param {value} key value of the key item | |
* @param {number} priority set the priority of the item |
This file contains hidden or 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
/*=====================================*\ | |
Trippy Build Tasks | |
\*=====================================*/ | |
/* | |
* TODO: Optimize build process to inject HTML & Javascript with browserSync | |
*/ | |
const gulp = require('gulp'); | |
const scss = require('gulp-sass'); |
This file contains hidden or 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
/** | |
* Singleton Pattern | |
* @returns {Object} | |
*/ | |
let Planet; | |
{ | |
let instance; | |
Planet = function () { |
This file contains hidden or 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
var getCoords = function (options) { | |
return new Promise(function (resolve, reject) { | |
navigator.geolocation.getCurrentPosition(resolve, reject, options); | |
}); | |
} | |
var geo_options = { | |
enableHighAccuracy: true, | |
maximumAge : 30000, | |
timeout : 27000 |