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
kevinmamaqi / optimize_pdf.sh
Created Jan 17, 2020
.SH script to optimize .PDF files in bulk inside a folder. #ghostscript
View optimize_pdf.sh
for f in *.pdf
do
echo $f;
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=a$f $f
done
@kevinmamaqi
kevinmamaqi / validateEmail.js
Last active May 29, 2019
Handy JS regex validation functions for email, name and website fields.
View validateEmail.js
// Source: https://stackoverflow.com/questions/46155/how-to-validate-an-email-address-in-javascript
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.