Skip to content

Instantly share code, notes, and snippets.


Néstor López nesslopz

  • México
View GitHub Profile
nesslopz / toSlug.js
Created Sep 22, 2019 — forked from igor822/toSlug.js
String to Slug
View toSlug.js
String.prototype.toSlug = function(){
str = this.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "ãàáäâèéëêìíïîõòóöôùúüûñç·/_,:;";
var to = "aaaaaeeeeiiiiooooouuuunc------";
for (var i=0, l=from.length ; i<l ; i++) {
str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
nesslopz /
Last active Mar 19, 2016 — forked from clauswitt/distance.js
Get the distance between two (world) coordinates - a nodejs module


NodeJs module to calc distances between two points using coords. Originally cloned from Response is in km


npm install distance.js --save


You can’t perform that action at this time.