Skip to content

Instantly share code, notes, and snippets.

Kevin kevinmamaqi

Block or report user

Report or block kevinmamaqi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kevinmamaqi /
Created Jan 17, 2020
.SH script to optimize .PDF files in bulk inside a folder. #ghostscript
for f in *.pdf
echo $f;
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=a$f $f
kevinmamaqi / validateEmail.js
Last active May 29, 2019
Handy JS regex validation functions for email, name and website fields.
View validateEmail.js
// Source:
function validateEmail(id) {
var regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i;
var ctrl = document.getElementById(id);
if (regex.test(ctrl.value)) {
return true;
else {
return false;
You can’t perform that action at this time.