Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Hakes mhakes

View GitHub Profile
View gist:2f639d4019a8238dfa92ba38db4caa82
This file has been truncated, but you can view the full file.
*M-UNKNOWN MEXICAN TRUCKING COMPANY
8CON CONTSHIP CONTAINER LINE
99M UNKNOWN MEXICAN OVERLAND CARRIER
AAAB AAA MOTORS
AAAC AAACTION TRANSPORTATION INC
AAAD A A A DELIVERY INC
AAAG ATC LOGISTICS INC
AAAO AAMODT INC
AAAU ASIA CONTAINER LEASING CO LTD
@mhakes
mhakes / mirror.js
Created May 12, 2017
Track changes to an object (very useful in form change tracking)
View mirror.js
/* jshint esnext: true */
/* global _ */
/* this version leverages _ lodash - oh Lord, stuck in lodash again */
const formatData = thing => {
if (_.isNil(thing)) {
return thing;
}
if (_.isEmpty(thing)) {
return thing;
}
View Denton.markdown

Denton

A Pen by mhakes on CodePen. This Constructor takes a jQuery form element, and allows for: beautifying, formatting, interacting, validating, populating and cultivating of the form. Purposely did not use $.fn to extend jQuery. Bootstrap used in this example

License.

@mhakes
mhakes / formatData.js
Last active Aug 29, 2015
underscorejs/lodash mixin that will return the numeric values (stored as strings) in an property, object, array or combination as well as strip slashes
View formatData.js
function formatData(thing) {
function sanitizeString(str) {
// discuss at: http://phpjs.org/functions/stripslashes/
// original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// improved by: Ates Goral (http://magnetiq.com)
// improved by: marrtins
// improved by: rezna
// fixed by: Mick@el
// bugfixed by: Onno Marsman
// bugfixed by: Brett Zamir (http://brett-zamir.me)