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 / _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;
@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 / 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 / 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 / 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 / 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 / angular-seamless-error-handling.js
Last active August 29, 2015 14:09
angular seamless error-handling
// new version with service and $injector.get('nameOfService'); ??
// ERROR-HANDLING
.config(function ($provide, $httpProvider) {
// error-interceptor
$provide.factory('errorHandlerInterceptor', function ($q, $rootScope) {
return {
response: function (response) {
// only handle remote XHR requests
if (response.config.url.search(/\/\//) !== -1) {
@gruppjo
gruppjo / read.md
Last active March 15, 2016 14:49
generator feature list for angular-cli discussion

Generator-M-Ionic provides

You are handed

  • a professional enterprise-level project with a complete development environment that is test-driven and continuous integration-ready for building apps with angular/ionic/cordova.
  • a sophisticated and fully-working project setup and a sample app built according to your choices (side-menu/tabs/blank). With all of that you can immediately start coding.
  • carefully integrated technology stack
    • Angular, Ionic, Cordova, additional bower components and Cordova Platforms and Plugins
    • SASS compilation (\w sourcemaps)
  • a powerful collection of gulp tasks for (that still is easy to configure for project specific needs)
    • live-reloading in the browser
  • automatic wiring of all components into your app
@gruppjo
gruppjo / blog-outline.md
Created April 20, 2016 10:42
Blog outline for Katie

Advanced workflows for building apps with Ionic

Part 1: Project Setup

  • Brief introduction of our company background, how and why we started using ionic, our clients as well as the common challenges we face building apps for them
  • Overview over blog series
  • More elaborate introduction of the tool we develop
  • Initial Project setup and project structure

Part 2: App Development

  • Quality Assurance, Coding guidelines
@gruppjo
gruppjo / release_actions.md
Last active September 13, 2016 11:27
generator release actions

Prepare release notes:

Prepare release

  • git checkout dev and git rebase master to check for any lost updates (shouldn't happen!!)
  • git checkout master and git merge dev and git push
    • do this via PR? Then we get code coverage statistics, nice diffs etc. but will have to create several pull requests with the other steps.
  • run generator in generator-demo dev branch (conserve readme, add proper version number), commit, rebase, git push
  • demo: git checkout master and git merge dev and git push