Skip to content

Instantly share code, notes, and snippets.

View harry-jones's full-sized avatar

Harry Jones harry-jones

View GitHub Profile
/* tooltips */
$( function()
{
var targets = $( '[rel~=tooltip]' ),
target = false,
tooltip = false,
title = false;
targets.bind( 'mouseenter', function()
{
/**
* Customer.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models
*/
module.exports = {
attributes: {
// find the existing customer or create a new one
Customer.findOrCreate({email: customer.email}, customer).exec(function (err, customerFound) {
if (err) {
sails.log(vehicle.vrm + ': error finding or creating customer');
sails.log(err);
return res.serverError(500);
}
else {
sails.log(vehicle.vrm + ": customer ID " + customerFound.id);
// find the existing customer or create a new one
Customer.findOrCreate({email: customer.email}, customer).exec(function (err, customerFound) {
if (err) {
sails.log(vehicle.vrm + ': error finding or creating customer');
sails.log(err);
return res.serverError(500);
}
else {
@harry-jones
harry-jones / uk-number-plate-validation.md
Last active January 26, 2024 00:10 — forked from danielrbradley/uk-number-plate-validation.md
Regular Expression to Validate UK Number Plates

Regular Expression to Validate UK Number Plates

Regular Expression

(?<Current>^[A-Z]{2}[0-9]{2}[A-Z]{3}$)|(?<Prefix>^[A-Z][0-9]{1,3}[A-Z]{3}$)|(?<Suffix>^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(?<DatelessLongNumberPrefix>^[0-9]{1,4}[A-Z]{1,2}$)|(?<DatelessShortNumberPrefix>^[0-9]{1,3}[A-Z]{1,3}$)|(?<DatelessLongNumberSuffix>^[A-Z]{1,2}[0-9]{1,4}$)|(?<DatelessShortNumberSufix>^[A-Z]{1,3}[0-9]{1,3}$)|(?<DatelessNorthernIreland>^[A-Z]{1,3}[0-9]{1,4}$)

Source information

DVLA website

Rules

module.exports = {
'verify-email': function(req, res) {
const kickbox = require('kickbox').client('dc3ecaf32a5dc30397f04c75b1e6e0e7182eda4f9d42c941a7928de9afd33580').kickbox();
if (!req.query.email) return res.send("Email address missing!");
var emailToVerify = req.query.email;