Skip to content

Instantly share code, notes, and snippets.

View christopherthielen's full-sized avatar

Chris Thielen christopherthielen

View GitHub Profile
package com.mediture.truchart.rest.resources;
import java.util.*;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
var previous = null, lastPrevious = null, memos = {};
$rootScope.$on("$transitionStart", function(evt, $transition$) {
lastPrevious = previous;
previous = $transition$.from;
$transition$.promise.then(commit).catch(revert);
function commit() { lastPrevious = null; }
function revert() { previous = lastPrevious; }
});
@christopherthielen
christopherthielen / gist:75065c8892db5ae1176d
Created January 27, 2015 23:20
Name Editor (Last, First, Middle, Suffix)
.directive("nameEditor", function($timeout) {
return {
controllerAs: 'ctrl',
bindToController: true,
scope: { name: '=name' },
template:
'<div ng-show="!ctrl.editing" class="col-sm-12">' +
' <input type="text" ng-model="ctrl.displayname" ng-model-options="{ getterSetter: true }" ng-focus="ctrl.editing = true">' +
'</div>' +
function decorateit(DDO) {
if (DDO.link) {
var reallink = DDO.link;
DDO.link = function(scope, elem, attrs, ctrls) {
scope.myCoolScopeFunction = function() {
// scope.$on or whatever you need
};
return reallink(scope, elem, attrs, ctrls);
}
@christopherthielen
christopherthielen / gist:4980c9117f3185906627
Created January 9, 2015 18:49
bootstrap tooltip activation based on scope data, not DOM events
/* Implement bootstrap tooltip activation based on scope data, not DOM events */
app.config(function($tooltipProvider) {
$tooltipProvider.setTriggers( {'openTrigger': 'closeTrigger'} );
});
app.directive('popPopup', function () {
return {
restrict: 'EA',
replace: true,
scope: { title: '@', content: '@', placement: '@', animation: '&', isOpen: '&' },
@christopherthielen
christopherthielen / angular-ui-router.js
Created November 21, 2014 02:35
0.2.13-build2 - Release Candidate
/**
* State-based routing for AngularJS
* @version v0.2.12-dev-2014-11-20
* @link http://angular-ui.github.com/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
/* commonjs package manager support (eg componentjs) */
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){
module.exports = 'ui.router';
/**
* State-based routing for AngularJS
* @version v0.2.12-dev-2014-11-20
* @link http://angular-ui.github.com/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
/* commonjs package manager support (eg componentjs) */
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){
module.exports = 'ui.router';
@christopherthielen
christopherthielen / angular-ui-router.js
Created November 13, 2014 22:20
angular-ui-router.js 0.2.12 release candidate 1
/**
* State-based routing for AngularJS
* @version v0.2.12-dev-2014-11-13
* @link http://angular-ui.github.com/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
/* commonjs package manager support (eg componentjs) */
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){
module.exports = 'ui.router';
@christopherthielen
christopherthielen / angular-ui-router.js
Last active August 29, 2015 14:06
ui-router 0.2.12-pre-2014-09-22
/**
* State-based routing for AngularJS
* @version v0.2.11-dev-2014-09-22
* @link http://angular-ui.github.com/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
/* commonjs package manager support (eg componentjs) */
if (typeof module !== "undefined" && typeof exports !== "undefined" && module.exports === exports){
module.exports = 'ui.router';
@christopherthielen
christopherthielen / gist:99f1ffb873493c83bb26
Created September 15, 2014 17:21
angular-ui-router.min.js v0.2.12-dev-2014-09-15
/**
* State-based routing for AngularJS
* @version v0.2.12-dev-2014-09-15
* @link http://angular-ui.github.com/
* @license MIT License, http://www.opensource.org/licenses/MIT
*/
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return J(new(J(function(){},{prototype:a})),b)}function e(a){return I(arguments,function(b){b!==a&&I(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var c=[];return b.forEach(a,function(a,b){c.push(b)}),c}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=0>d?Math.ceil(d):Math.floor(d),0>d&&(d+=c);c>d;d++)if(d in a&&a[d]===b)return d;return-1}function i(a,b,c,d){var e,i=f(c,d),j={},k=[];for(var l in i)if(i[l].params&&(e=g(i[l].params)