Skip to content

Instantly share code, notes, and snippets.

View tjvantoll's full-sized avatar

TJ VanToll tjvantoll

View GitHub Profile

HTML5 Form Validation: Why no one uses it, and how you can!

Client-side form validation is a notoriously painful development experienece. Yet, despite HTML5 constraint validation—a series of APIs designed to make form validation way easier—being implemented in most browsers, no one actually uses it. In this talk you'll see why. We'll discuss constraint validation's pain points, and how you can overcome them in your own applications. Come learn how to use HTML5 form validation today!

@tjvantoll
tjvantoll / test.txt
Created September 2, 2014 17:42
Test
Test gist for playing with the GitHub API.
@tjvantoll
tjvantoll / user-agent.md
Last active August 29, 2015 14:04
IE 11 Mobile's User-Agent Header

Mozilla/5.0 (Mobile; Windows Phone 8.1; Android 4.0; ARM; Trident/7.0; Touch; rv:11.0; IEMobile/11.0; NOKIA; Lumia 520) like iPhone OS 7_0_3 Mac OS X AppleWebKit/537 (KHTML, like Gecko) Mobile Safari/537

Thanks to Eric Lawrence, who posted it in two tweets (because it doesn't fit in one).

@tjvantoll
tjvantoll / class-name-formatting.md
Last active August 29, 2015 14:03
Class Name Formatting Question

The following code adds a [placeholder] class name to the <body> element:

document.body.classList.add( "foo-bar" );

Question: How should the class name inserted at [placeholder] be formatted?

module.exports = function( grunt ) {
"use strict";
var version = "2.1.1",
exclude = [ "ajax" ],
dest = "jquery-built.js"
exclude.forEach(function( module, index ) {
exclude[ index ] = "-" + module;
});
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
# Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.png
# A big thanks to \amethyst on Freenode
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery 2.1.0 Parse/Execute Test</title>
</head>
<body>
<script>var start = new Date();</script>
<?xml version="1.0"?>
<entries>
<entry type="method" name="jQuery.widget">
<title>Widget Factory</title>
<signature>
<argument name="name" type="String">
<desc>The name of the widget to create, including the namespace.</desc>
</argument>
<argument name="base" type="Function" optional="true">
<desc>The base widget to inherit from. This must be a constructor that can be instantiated with the `new` keyword. Defaults to <code>jQuery.Widget</code>.</desc>
@tjvantoll
tjvantoll / readme.diff
Created November 26, 2013 14:26
README diff
diff --git a/README.md b/README.md
index 9731e95..7c730ce 100644
--- a/README.md
+++ b/README.md
@@ -50,8 +50,8 @@ cd jquery-ui
# Install the node module dependencies
npm install
-# Run the build task
-grunt build
@tjvantoll
tjvantoll / TestServlet.java
Created November 19, 2013 21:39
Hello World, JEE Style
package com.tj;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class TestServlet extends HttpServlet {