Skip to content

Instantly share code, notes, and snippets.

View tcdevs's full-sized avatar

TC Devs tcdevs

  • Technische Centrale
View GitHub Profile
@tcdevs
tcdevs / httpInterceptor.js
Last active October 14, 2015 07:47
intercept data from $http service
// Via http://dottedsquirrel.com/blog/angular-js-how-to-intercept-data-from-http-services-and-override-default-json-parse-when-syntaxerror-unexpected-token-occurs/
$http({
url: '...',
method: 'GET',
transformResponse: [function (data) {
// Do whatever you want!
return data;
}]
});
@tcdevs
tcdevs / debugview.js
Created October 1, 2015 09:11
debugView Directive AngularJS
/**
* debugView Module
* Copyright (c) 2015 tcdevs https://gist.github.com/tcdevs
*
* A directive that will show json data that's provided via the data attribute in a pre element.
* Can be globally config with the debugMode AngularJS value
*
*/
angular.module('debugView', [])
// Globally toggle all the debug-view directives
@tcdevs
tcdevs / navbarSizes.css
Last active August 29, 2015 14:24
BS3 navbar different sizes
/*
Via: http://stackoverflow.com/a/28103335
Usage: <div class="navbar navbar-xs"></div>
*/
.navbar-xs { min-height:28px; height: 28px; }
.navbar-xs .navbar-brand{ padding: 0px 12px;font-size: 16px;line-height: 28px; }
.navbar-xs .navbar-nav > li > a { padding-top: 0px; padding-bottom: 0px; line-height: 28px; }
.navbar-xl { min-height:60px; height: 60px; }
.navbar-xl .navbar-brand{ padding: 0px 12px;font-size: 16px;line-height: 60px; }
@tcdevs
tcdevs / navbarfx.js
Last active August 29, 2015 14:24
Bootstrap 3 Navbar Effects
// via https://medium.com/@mrbigdreamerYWF/bootstrap-3-navbar-effects-3fa158414eda
// Add slideDown animation to dropdown
$('.dropdown').on('show.bs.dropdown', function(e) {
$(this).find('.dropdown-menu').first().stop(true, true).slideDown().fadeIn("fast");
});
// Add slideUp animation to dropdown
$('.dropdown').on('hide.bs.dropdown', function(e) {
$(this).find('.dropdown-menu').first().stop(true, true).fadeIn().fadeOut("fast");
});