Skip to content

Instantly share code, notes, and snippets.

View matthewbednarski's full-sized avatar

Matthew Bednarski matthewbednarski

  • Barbarano Vicentino (VI), Italy
View GitHub Profile
@matthewbednarski
matthewbednarski / index.html
Created September 3, 2015 15:45
index.html
<!DOCTYPE html>
<html manifest="manifest.appcache">
<head>
<link href="css/custom.css" rel="stylesheet" type="text/css" />
<link href="libs/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> <script src="libs/lodash.js/3.10.1/lodash.min.js"></script> <script src="libs/jquery/2.1.4/jquery.min.js"></script>
<script src="libs/angular.js/1.3.18/angular.min.js"></script>
<script src="libs/moment.js/2.10.3/moment-with-locales.min.js"></script>
<script src="libs/bootstrap-datepicker/1.4.0/js/bootstrap-datepicker.min.js"></script>
<link href="libs/bootstrap-datepicker/1.4.0/css/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css" />
<link href="libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
@matthewbednarski
matthewbednarski / single-select-directive.js
Created September 9, 2015 15:57
a directive to show a single available item as a text box
(function() {
var app = angular.module('mcbSingleSelect', [])
.directive('singleSelect', [singleSelectDirective]);
function singleSelectDirective() {
return {
restrict: 'EA', //E = element, A = attribute, C = class, M = comment
scope: {
//@ reads the attribute value, = provides two-way binding, & works with functions
optionsList: '=?',
'use strict';
(function() {
angular
.module('mcbPersist', [])
.service('persist', ['$q', persistService]);
function persistService($q) {
var persist = this;
this.getDb = function() {
if (this.db === undefined) {
@matthewbednarski
matthewbednarski / app.js
Last active September 24, 2015 15:05
datepicker-directive.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,
@matthewbednarski
matthewbednarski / queue-service.js
Created September 17, 2015 15:05
An angular service providing a simple queue
(function(){
var app = angular.module('mcbQueue', [])
.service('queue', [Queue]);
/**
* Queue.js
*
* A function to represent a queue
*
@matthewbednarski
matthewbednarski / globals-service.js
Created September 17, 2015 15:08
provides injectable versions of lodash and moment global variables
(function(){
var app = angular.module('mcbGlobals', [])
.service('lodash', [Lodash])
.service('moment', [Moment]);
function Lodash() {
return window._;
}
@matthewbednarski
matthewbednarski / AppContext.java
Created September 24, 2015 10:36
gives access to the ApplicationContext
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 / spinner-directive.js
Created September 24, 2015 12:56
A bootstap modal with a spinner
(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 / tree-directive.js
Created September 30, 2015 07:43
an angular 1.x directive for bootstrap-treeview
(function($) {
/**
* A [bootstrap-treeview](https://github.com/jonmiles/bootstrap-treeview) directive.
*
* requires:
* bootstrap-treeview: v 1.2.0
*
*/
@matthewbednarski
matthewbednarski / smart-table.js
Created September 30, 2015 09:06
an updated version of the 2.1.3 version of angular Smart Table allowing for the swapping out of many similar sized arras
/**
* @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',