Skip to content

Instantly share code, notes, and snippets.

Avatar

Harry Jones harry-jones

View GitHub Profile
View tooltips.js
/* tooltips */
$( function()
{
var targets = $( '[rel~=tooltip]' ),
target = false,
tooltip = false,
title = false;
targets.bind( 'mouseenter', function()
{
View Customer.js
/**
* 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: {
View CustomerController.js
// 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);
View CustomerController.js
// 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 Jun 28, 2019 — forked from danielrbradley/uk-number-plate-validation.md
Regular Expression to Validate UK Number Plates
View uk-number-plate-validation.md

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

View CustomerController.js
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;
You can’t perform that action at this time.