Skip to content

Instantly share code, notes, and snippets.

View hartzis's full-sized avatar

(Brian) Emil Hartz hartzis

View GitHub Profile
@hartzis
hartzis / _.md
Created April 16, 2014 02:57
CMPD-dot-line-graph
@hartzis
hartzis / _.md
Created April 21, 2014 19:57
hove pie example -
@hartzis
hartzis / _.md
Created April 23, 2014 14:47
front range map test
@hartzis
hartzis / _.md
Created April 25, 2014 14:57
front range polymap
@hartzis
hartzis / _.md
Created May 6, 2014 03:29
specialty list
var parseTweet = function(tweetText) {
var reghash, reguri, regusername;
reguri = /(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/=]*))/g;
regusername = /([@]+([A-Za-z0-9-_]+))/g;
reghash = /[#]+([A-Za-z0-9-_]+)/g;
tweetText = tweetText.replace(reguri, "<a href='$1' target='_blank'>$1</a>");
tweetText = tweetText.replace(regusername, "<a href='http://twitter.com/$2' target='_blank'>$1</a>");
tweetText = tweetText.replace(reghash, "<a href='http://twitter.com/search?q=%23$1' target='_blank'>#$1</a>");
return tweetText;
};
@hartzis
hartzis / gist:c6014b6289fab5e32d06
Created June 25, 2014 18:36
ngEnter - Watch for enter keypress
var ngEnterDirectives = angular.module('ngEnterDirectives', []);
/*
This directive allows us to pass a function in on an enter key to do what we want.
*/
ngEnterDirectives.directive('ngEnter', function () {
return function (scope, element, attrs) {
element.bind("keydown keypress", function (event) {
if(event.which === 13) {
scope.$apply(function (){
scope.$eval(attrs.ngEnter);
@hartzis
hartzis / _.md
Created July 7, 2014 15:39
Hello World
@hartzis
hartzis / jquery password validation
Created September 5, 2014 15:53
Beautiful password validation from stackexchange, 8 chars, 1 upper, 1 lower, 1 special
// Hold functions related to client side password validation
var password = function () {
var minPasswordLength = 8;
var _hasLowerCase = /[a-z]/;
var _hasUpperCase = /[A-Z]/;
var _hasDigit = /\d/;
var _hasNonWord = /(_|[^\w\d])/;
var password = [];
@hartzis
hartzis / gist:fc40bfeff24ef7a13c21
Created September 11, 2014 04:21
create github social link
(function(){
'use strict';
$(document).on('ready', function(){
var getGitHubSocialInfo = function(githubURLJSON, githubURL, containerEl) {
$.ajax({
url: githubURLJSON,
dataType: "jsonp",
success: function(data) {
var theCount = data.data.watchers_count;