Skip to content

Instantly share code, notes, and snippets.

View ndayananda's full-sized avatar
💭
Front-End Developer | JavaScript Developer | UI Developer | ♥ JavaScript

Naveen Dayananda ndayananda

💭
Front-End Developer | JavaScript Developer | UI Developer | ♥ JavaScript
View GitHub Profile
const getCallerName = () => {
const stackTrace: any = new Error().stack || '';
let callerName = stackTrace.replace(/^Error\s+/, ''); // Sanitize Chrome
callerName = callerName.split('\n')[2]; // 1st item is this, 2nd item is caller
callerName = callerName.replace(/^\s+at Object./, ''); // Sanitize Chrome
callerName = callerName.replace(/ \(.+\)$/, ''); // Sanitize Chrome
return callerName.replace('at ', '');
};
@ndayananda
ndayananda / demo.less
Created August 9, 2017 12:32 — forked from juanbrujo/demo.less
@font-face LESS Mixin
// USE
.font-face(Ubuntu-Regular, 'https://dl.dropbox.com/u/1220078/ubuntu-new/Ubuntu-Regular-webfont', 400, normal);
.font-face(Ubuntu-Italic, 'https://dl.dropbox.com/u/1220078/ubuntu-new/Ubuntu-Regular-Italic-webfont', 400, italic);
.font-face(Ubuntu-Bold, 'https://dl.dropbox.com/u/1220078/ubuntu-new/Ubuntu-Bold-webfont', 700, normal);
.test {
.font(Ubuntu-Regular, 1em, normal, normal);
h1 {
.font(Ubuntu-Bold, 1.7em, bold, normal);
}