Skip to content

Instantly share code, notes, and snippets.

View nestorandrespe's full-sized avatar
👨‍🚀
Working from space

Néstor Andrés Peña nestorandrespe

👨‍🚀
Working from space
View GitHub Profile
@MrOrz
MrOrz / test_readability.js
Created March 19, 2018 16:42
Test web page summarization with Mozilla/Readability.js and puppeteer
const DOC_URL = process.argv[2];
const puppeteer = require('puppeteer');
const fs = require('fs');
const readabilityJsStr = fs.readFileSync('node_modules/readability/Readability.js', {encoding: 'utf-8'})
function executor() {
return new Readability({}, document).parse();
}
@john-guerra
john-guerra / .block
Last active October 18, 2023 22:51
GeoJson map of Colombia Municipios
license: mit
@codeguy
codeguy / slugify.js
Created September 24, 2013 13:19
Create slug from string in Javascript
function string_to_slug (str) {
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;";
var to = "aaaaeeeeiiiioooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
}