Skip to content

Monthly Archives: November 2018

Jasmine unit tests throwing "Possibly unhandled rejection" with Angular 1.6?

09-Nov-18

Each $q.reject() throws an error if not being chained properly. First check that all calls have a .catch(). Second, if possible, isolate your error cases to an independent describe block. Example below using bardjs, but the idea should be clear enough. let stuffDataservice; const stuff = [{}]; beforeEach(function() { [...] stuffDataservice = { getStuff: function […]

JavaScript: get domain from url with JS regex

07-Nov-18

It's as simple as url.match(/\/\/(.[^/]+)/)[1]. Requires the double slash before the domain part, but not a slash after it.

Bootstrap 3 text-align (left/right) for xs, sm, md, lg screen sizes

02-Nov-18

/** * Text alignment for screen sizes */ @media (max-width:767px){ .xs-text-right { text-align: right; } .xs-text-left { text-align: left; } } @media (min-width:768px){ .sm-text-right { text-align: right; } .sm-text-left { text-align: left; } } @media (min-width:992px){ .md-text-right { text-align: right; } .md-text-left { text-align: left; } } @media (min-width:1200px){ .lg-text-right { text-align: right; } .lg-text-left […]