Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>
<script>
$(document).ready(function(){
$("#registerForm").validate();
});
</script>
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="http://ajax.microsoft.com/ajax/jquery.validate/1.15.0/jquery.validate.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.15.0/additional-methods.min.js"></script>
<script>
$(document).ready(function(){
$.validator.addMethod("mustbeyoungerthan", function(value, element) {
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout-validation/2.0.3/knockout.validation.min.js"></script>
</head>
<body>
<script id="customMessageTemplate" type="text/html"><!--
@kahneraja
kahneraja / DevProgressDeveloperWorkflow.md
Last active August 12, 2016 23:24
DevProgress Developer Workflow

Big Theta Notation: Actual complexity. Big O Notation: Worst case complexity. Big Omega notation: Best ase complexity.

Standard function asymptotic analysis.

  • Constant: O(1)
  • Linear: O(N)
  • One nested loop: O(N^2)
  • Binary Tree Search: O(Log N)
  • Simple recursive function: O(N)
/*
To run locally...
$> npm install mocha -g
$> mocha bastille.spec.js
*/
"use strict";
var assert = require("assert");
var Bastille = function (){
@kahneraja
kahneraja / gist:0caeb89486c9cc33ddcab225b5e9c01f
Last active December 20, 2017 19:23
Scala Worksheet: How to inject an implicit value into a Play json serializer...?
import play.api.libs.json._
import play.api.libs.json.Reads._
import play.api.libs.functional.syntax._
case class GlobalConfig(defaultAge: Int)
val config = GlobalConfig(34)
case class Person(name: String, age: Int)
object Person {
@kahneraja
kahneraja / gist:cc8f47e3a0eb876ef2f4c94f21cdc90a
Created December 21, 2017 15:48
SCALA WORKSHEET: Some ideas around how a Use Case pattern might help.
// REQUESTVAlIDATORS
trait RequestValidator {
def Validate(): Boolean // various approaches to validating http requests
}
// AUTHPOLICIES
trait AuthPolicy {
def Authorize() // handle user context and various exceptions
}
@kahneraja
kahneraja / gist:4199a2ccb621a7e15842a4d64a9d4f38
Last active January 5, 2018 14:40
Exploring Super Interfaces in Java 8.
/* INTERFACES */
interface Plane {
default void drive() {
System.out.println("We are driving a plane!");
}
}