Skip to content

Instantly share code, notes, and snippets.

View failpunk's full-sized avatar

Justin Vencel failpunk

View GitHub Profile
@failpunk
failpunk / gist:5881482
Created June 28, 2013 00:11
jQuery autocomplete directive for Angular.js
var cnJqueryUi = angular.module('cn.jquery', []);
cnJqueryUi.directive('autoComplete', function($http) {
// by default do not format autocomplete data
var defaultFormatter = function(data) { return data };
return {
scope: {
@failpunk
failpunk / gist:5833353
Created June 21, 2013 18:41
Simple Angular.js filter for using the moment.js library
angular.module('myFilters', []).filter('momentjs', function() {
return function(input, formatString) {
var m = moment(input)
, formatString = formatString || ''
, out = '';
if(m && m.isValid()) {
if(formatString == 'calendar') {
out = m.calendar();