Skip to content

Instantly share code, notes, and snippets.

View merolhack's full-sized avatar

Lenin Jose Meza Zarco merolhack

View GitHub Profile
@merolhack
merolhack / app.js
Last active November 7, 2020 01:41 — forked from rnkoaa/app.js
A simple angularjs with angular-ui modal form which includes validation on the client side.Thanks http://scotch.io/tutorials/javascript/angularjs-form-validation
var app = angular.module("modalFormApp", ['ui.bootstrap']);
app.controller("modalAccountFormController", ['$scope', '$uibModal', '$log',
function ($scope, $uibModal, $log) {
$scope.showForm = function () {
$scope.message = "Show Form Button Clicked";
console.log($scope.message);
var uibModalInstance = $uibModal.open({
@merolhack
merolhack / slugify.js
Last active May 29, 2023 11:30 — forked from mathewbyrne/slugify.js
Javascript Slugify: For accents and other latin characters
function slugify(text)
{
var from = "ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;";
var to = "aaaaaeeeeeiiiiooooouuuunc------";
_.each( from, function( character, i ) {
text = text.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i));
});
return text
.toString() // Cast to string
.toLowerCase() // Convert the string to lowercase letters