Skip to content

Instantly share code, notes, and snippets.

@RobJohnston
RobJohnston / HelpTextOnFormElements.html
Last active January 19, 2016 20:28
Help text on form elements (github.com/wet-boew/wet-boew/issues/6613).
<form role="form" method="get" action="#">
<div class="text-left">
<div class="row">
<div class="col-xs-12 col-md-4">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email" aria-describedby="help-email" />
</div>
</div>
<div class="col-xs-6 col-md-8">
@RobJohnston
RobJohnston / mrtd.js
Created September 28, 2017 17:29
jQuery Validation method for the Machine Readable Zone of a Machine Readable Travel Document.
/*
Validate the Machine Readable Zone (MRZ) of any Machine Readable Travel Document (MRTD) conforming with the
specifications of ICAO Doc 9303-4.
This method can validate:
* a Machine Readable Passports (MRP) and other TD3 sized MRTDs;
* a Machine Readable Official Travel Document (MROTD); and
* a Machine Readable Visa (MRV).
This method does not validate:

Keybase proof

I hereby claim:

  • I am robjohnston on github.
  • I am rob_johnston (https://keybase.io/rob_johnston) on keybase.
  • I have a public key ASAiC0O_0yGHtNKLG3MnTfVnjPXaYi8XX4P5xgv1Hu6IZwo

To claim this, I am signing this object:

@RobJohnston
RobJohnston / LabelRequiredTagHelper.cs
Last active August 16, 2020 01:49
Extend the razor page's label tag helper to write labels the WET-BOEW way. Be sure to add `@addTagHelper *, WebApplication1` to the Pages/_ViewImports.cshtml file.
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.TagHelpers;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Razor.TagHelpers;
using System;
using System.Text.Encodings.Web;
using System.Threading;
using System.Threading.Tasks;