Skip to content

Instantly share code, notes, and snippets.

@jkfran
jkfran / aeat_verified_NIF.php
Created May 3, 2017 10:08
Comprobar validez de NIF y Nombre con la Agencia Tributaria
<?php
/**
* Previamente convertir ceritificado .p12 o pfx a .key.pem y .crt.pem:
*
* openssl pkcs12 -in ciar.pfx -out cia.key.pem -nocerts -nodes
* openssl pkcs12 -in ciar.p12 -out ciar.crt.pem -clcerts -nokeys
*
**/
$CERT_CRT_PEM = 'certificado.crt.pem';
@Celleb
Celleb / aajquery.validate.additional-methods.js
Last active March 16, 2018 15:39
Additional methods for jquery.validate.js plugin. Adds functionality to match to input elements ie. Password and confirm password. Look up functionality - to lookup if the entered info is in the database i.e codes etc. Duplicates - to lookup for duplicates in the database. You need the jquery validation plugin from http://jqueryvalidation.org/
(function() {
/* This method is to match two input elements */
jQuery.validator.addMethod("match", function(value, element, options) {
if (value === $(options).val()) {
return true;
} else {
return false;
}