Skip to content

Instantly share code, notes, and snippets.

Matthew Bednarski matthewbednarski

Block or report user

Report or block matthewbednarski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@matthewbednarski
matthewbednarski / spinner-directive.js
Created Oct 1, 2015
a spinner directive using bootstrap modal and font-awesome fonts
View spinner-directive.js
(function() {
var app = angular.module('mcbSpin', [])
.directive('spinner', [Spinner]);
function Spinner() {
return {
restrict: 'EA', //E = element, A = attribute, C = class, M = comment
scope: {
//@ reads the attribute value, = provides two-way binding, & works with functions
show: '@',
@matthewbednarski
matthewbednarski / focus-directive.js
Last active Sep 30, 2015
a directive to give focus to an element, adds tabindex if the element doesn't already have it
View focus-directive.js
(function() {
var app = angular.module('mcbFocus', [])
.directive('focusOn', function() {
return function(scope, elem, attr) {
if(attr.tabIndex === undefined){
elem.attr('tabindex', -1);
}
scope.$on('focusOn', function(e, name) {
if (name === attr.focusOn) {
elem[0].focus();
@matthewbednarski
matthewbednarski / smart-table.js
Created Sep 30, 2015
an updated version of the 2.1.3 version of angular Smart Table allowing for the swapping out of many similar sized arras
View smart-table.js
/**
* @version 2.1.3
* @license MIT
*/
(function(ng, undefined) {
'use strict';
ng.module('smart-table', []).run(['$templateCache',
function($templateCache) {
$templateCache.put('template/smart-table/pagination.html',
@matthewbednarski
matthewbednarski / tree-directive.js
Created Sep 30, 2015
an angular 1.x directive for bootstrap-treeview
View tree-directive.js
(function($) {
/**
* A [bootstrap-treeview](https://github.com/jonmiles/bootstrap-treeview) directive.
*
* requires:
* bootstrap-treeview: v 1.2.0
*
*/
@matthewbednarski
matthewbednarski / spinner-directive.js
Created Sep 24, 2015
A bootstap modal with a spinner
View spinner-directive.js
(function() {
var app = angular.module('mcbSpin', [])
.directive('spinner', [Spinner]);
function Spinner() {
return {
restrict: 'EA', //E = element, A = attribute, C = class, M = comment
scope: {
//@ reads the attribute value, = provides two-way binding, & works with functions
show: '@',
@matthewbednarski
matthewbednarski / AppContext.java
Created Sep 24, 2015
gives access to the ApplicationContext
View AppContext.java
package it.solinfo.xdsindexer.utils;
import org.apache.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import javax.inject.Named;
/**
@matthewbednarski
matthewbednarski / globals-service.js
Created Sep 17, 2015
provides injectable versions of lodash and moment global variables
View globals-service.js
(function(){
var app = angular.module('mcbGlobals', [])
.service('lodash', [Lodash])
.service('moment', [Moment]);
function Lodash() {
return window._;
}
@matthewbednarski
matthewbednarski / queue-service.js
Created Sep 17, 2015
An angular service providing a simple queue
View queue-service.js
(function(){
var app = angular.module('mcbQueue', [])
.service('queue', [Queue]);
/**
* Queue.js
*
* A function to represent a queue
*
@matthewbednarski
matthewbednarski / app.js
Last active Sep 24, 2015
datepicker-directive.js
View app.js
(function() {
var app = angular.module('app', [ 'siDate'])
.service('datePickerConfig', ['$document', datePickerConfig]);
function datePickerConfig($document) {
var defaults = {
autoclose: true,
beforeShowDay: $.noop,
calendarWeeks: true,
clearBtn: false,
View pouchdb-service.js
'use strict';
(function() {
angular
.module('mcbPersist', [])
.service('persist', ['$q', persistService]);
function persistService($q) {
var persist = this;
this.getDb = function() {
if (this.db === undefined) {
You can’t perform that action at this time.