Skip to content

Instantly share code, notes, and snippets.

View jessegavin's full-sized avatar

Jesse Gavin jessegavin

View GitHub Profile
1 Abbot of Keral Keep (ori) 127
1 Abrade (vow) 139
1 Academy Ruins (mma) 219
1 Acidic Slime (m10) 165
1 Adanto Vanguard (mb1) 10
1 Adeline, Resplendent Cathar (mid) 1
1 Ancestral Recall (leb) 48
1 Ancestral Vision (tsr) 52
1 Ancient Tomb (plist) 574
1 Animate Dead (me1) 57
{
"version": "1.1",
"title" : "My Cars",
"vehicles" : [
{
"make": "Volkswagen",
"model": "Beetle",
"year": 1953,
"color": "Green",
"engine": {
@jessegavin
jessegavin / capture-helper-params.js
Created April 28, 2016 02:14 — forked from innerfunction/capture-helper-params.js
Node.js module for capturing parameter values being passed to a dust.js helper. For example, if calling a helper {@Helper p1="{p1}" p2="{p2}"/}, this code will resolve values for p1 and p2 in a fully asynchronous manner before calling the helper function. Use the wrapper function as: var wrapper = require('./capture-helper-params'); helpers['myh…
// Capture templated parameter values passed to a dust.js helper function.
function captureParams(chunk, context, params, cb) {
// Object for recording resolved parameter values.
var values = {};
// Capture a single parameter value.
// @param {name} The parameter name.
// @param {next} Next step in the capture chain.
function capture( name, next ) {
return function( chunk ) {
// If the parameter value is a function then it is a dust.js template that needs to be
@jessegavin
jessegavin / theme.css
Created February 24, 2016 15:17
CodePen theme for JSONView
@import url(https://fonts.googleapis.com/css?family=Inconsolata);
body {
white-space: pre;
font-family: "Inconsolata";
background-color: rgb(29, 31, 32);
color: #eee;
}
.property {
body {
margin-bottom: 23px;
white-space: normal !important;
}
ul {
list-style-type: none;
padding: 0px;
margin: 0px 0px 0px 26px;
}
@jessegavin
jessegavin / A-Pen-by-Jesse-Gavin.markdown
Created September 20, 2013 17:22
A Pen by Jesse Gavin.
@jessegavin
jessegavin / lodash-mixins.js
Created September 4, 2013 21:33
Here's a lodash mixin that works sort of like _.filter(), however the matching items will be removed from the source array.
_.mixin({
'multiSplice': function (array, indexes) {
if (!_.isArray(array) || !_.isArray(indexes) || !_.all(indexes, _.isNumber)) {
return [];
}
var results = [];
if (indexes.length > 0) {
var i = indexes.length - 1;
for (; i >= 0; i--) {
Outcome<string> IAuthenticationService.ValidatePassword(IDssPrincipal dssPrincipal, string password)
{
const int minimumLength = 8;
const int maximumLength = 20;
const string specialCharactersPattern = @"\#\$\%\&\@\*\+\-\=\!\.\?\:\;\(\)\[\]\{\}\^\~_";
var observations = new List<string>();
var email = dssPrincipal.Identity.EmailAddress.ToMaybe();
// Password must not be null
@jessegavin
jessegavin / gist:3033734
Created July 2, 2012 15:17
Functional Question
private IEnumerable<Func<string, Maybe<string>, Outcome<string>>> GetValidators()
{
// Password cannot be empty
yield return (password, email) => string.IsNullOrWhiteSpace(password)
? Outcome.Failure("Password cannot be empty")
: Outcome.Success();
// Password must have at least 8 characters
yield return (password, email) =>
{
Server Error in '/' Application.
The property MvcApp.Models.ISpy.Name could not be found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: The property MvcApp.Models.ISpy.Name could not be found.
Source Error: