Skip to content

Instantly share code, notes, and snippets.

View johnnyreilly's full-sized avatar

John Reilly johnnyreilly

View GitHub Profile
@johnnyreilly
johnnyreilly / README.md
Created November 17, 2023 07:30
Get your MVP data for your records

MVP Application

Get your data from the API and write it to a file.

Read index.js for more information.

To run this:

@johnnyreilly
johnnyreilly / sh
Last active February 21, 2021 19:29
markdown blogpost with sed
// with markdown
npx markdown README.md | sed -e 's|<pre>|<pre class="prettyprint json">|'
// with showdown
npx showdown makehtml -i README.md
Goals:
- single page application
- code splitting
- ts-loader?
- react
- TypeScript
- .NET backend (C#)
- swagger
- auto-generated TypeScript client
- continuous deployment
<!DOCTYPE html>
<!-- saved from url=(0094)http://johnnyreilly.github.io/jQuery.Validation.Unobtrusive.Native/AdvancedDemo/Globalize.html -->
<html lang="en" class=" js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Globalize - jQuery Validation Unobtrusive Native</title>
<link href="https://johnnyreilly.github.io/jQuery.Validation.Unobtrusive.Native/Content/
@johnnyreilly
johnnyreilly / comparers.js
Last active September 2, 2015 14:53
Helper functions for sorting arrays by multiple criteria
function composeComparers(...comparers) {
return comparers.reduce((prev, curr) => (a, b) => prev(a, b) || curr(a, b));
}
function stringComparer(propLambda) {
return (obj1, obj2) => {
const obj1Val = propLambda(obj1) || '';
const obj2Val = propLambda(obj2) || '';
return obj1Val.localeCompare(obj2Val);
};
@johnnyreilly
johnnyreilly / confirm.html
Last active December 29, 2015 08:19
Rolling your own confirm mechanism using Q and jQuery UI
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Roll your own confirm</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<style type="text/css">
body {
padding: 0em 1em 0em;
}
@johnnyreilly
johnnyreilly / jquery.validate.unobtrusive-remote.js
Last active December 22, 2015 23:29
jQuery Remote Validation gets unobtrusively driven additional parameters.
(function($) {
var originalRemote = $.validator.methods.remote;
$.validator.methods.remote = function(value, element, param) {
param.data = {};
if (param.dataSelector) {
var dataToSend = $(element)
.closest(param.dataSelector)
@johnnyreilly
johnnyreilly / Index.js
Last active December 19, 2015 09:39
TypeScript and Cassette
/// <reference path="../../typings/jquery/jquery.d.ts" />
// @reference ~/bundles/core
$(document).ready(function () {
var $body = $("#body");
$body.fadeOut(1000, function () {
$body.html('<div style="width: 150px; margin: 0 auto;">I made it all go away...</div>').fadeIn();
});
});
//@ sourceMappingURL=Index.js.map
@johnnyreilly
johnnyreilly / Demo.html
Last active June 18, 2018 13:58
jQuery Validate - using the native unobtrusive support
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<style>
form { padding: 10px; }
.error { color: red; }
</style>
</head>
@johnnyreilly
johnnyreilly / Index.js
Last active December 17, 2015 23:59
Cassette and Asset References
// @reference ~/bundles/core
$(document).ready(function () {
var $body = $("#body");
$body.fadeOut(1000, function() {
$body.html(
'<div style="width: 150px; margin: 0 auto;">'+