Skip to content

Instantly share code, notes, and snippets.

View gruppjo's full-sized avatar
🌈
Sparkling

Jonathan Grupp gruppjo

🌈
Sparkling
View GitHub Profile
@gruppjo
gruppjo / isemptyobject.js
Created July 24, 2014 11:32
angularjs - empty object filter
'use strict';
angular.module('crmApp')
.filter('isEmptyObject', function () {
return function (obj) {
return angular.equals({}, obj);
};
});
@gruppjo
gruppjo / match.js
Last active August 29, 2015 14:03
match directive
'use strict';
angular.module('crmApp')
.directive('match', function () {
return {
restrict: 'A',
require: 'ngModel',
scope: {
match: '='
},
@gruppjo
gruppjo / survey.conf
Created April 3, 2014 07:47
template for linux services
description "starts an survey tools node server"
author "JG <[email protected]>"
start on (local-filesystems and net-device-up)
stop on shutdown
respawn
respawn limit 5 60
# Start the process
@gruppjo
gruppjo / mocke2e.js
Created March 24, 2014 14:59
$httpBackend ngMockE2E
// define new module myApp-mock
angular.module('myApp-mock', ['ngMockE2E'])
// we want to use $httpBackend mock
.run(function($httpBackend) {
$httpBackend.whenGET(/.*/).passThrough();
$httpBackend.whenPOST(/^http:\/\/labdemcap.*/).respond(function (method, url, data) {
data = JSON.parse(data);
var sapFunction = 'sap_function';
sapFunction = data.service.request[sapFunction];
@gruppjo
gruppjo / interceptors.js
Last active August 29, 2015 13:57
angular interceptors example setup (with $provide in config)
'use strict';
angular.module('tradecore')
.constant('Config', {
baseUrl: 'http://62.26.167.30/tca'
})
.config(function ($provide, $httpProvider) {
$provide.factory('errorHandlerInterceptor', function ($q) {
// be careful when injecting services here
// circular dependencies will occur when injecting services that use $http
@gruppjo
gruppjo / _loading.scss
Last active August 29, 2015 13:56
css: loading animation - basic
// inspired by http://codepen.io/anon/pen/fGatk
// don't use on :before in older Webkits (e.g iOS6) - http://css-tricks.com/pseudo-element-animationstransitions-bug-fixed-in-webkit/
@mixin loading($radius, $width, $bgColor, $fgColor) {
display:inline-block;
width: $radius;
height: $radius;
@include border-radius(50%);
background-color: transparent;
animation: rotate .75s infinite linear;