Skip to content

Instantly share code, notes, and snippets.

View Zizzamia's full-sized avatar

Leonardo Zizzamia Zizzamia

View GitHub Profile
const options = {
firstPaint: false,
firstContentfulPaint: false,
timeToInteractive: false,
googleAnalytics: {
enable: false,
timingVar: "name",
},
logging: true,
logPrefix: "⚡️ Perfume.js:"
@Zizzamia
Zizzamia / perfume-time-to-interactive.js
Last active January 14, 2018 23:55
Perfume Time to Interactive
const perfume = new Perfume({
timeToInteractive: true
});
// ⚡️ Perfume.js: Time to interactive 2452.07 ms
perfume.start('togglePopover');
$(element).popover('toggle');
perfume.endPaint('togglePopover');
// ⚡️ Perfume.js: togglePopover 10.54 ms
@Zizzamia
Zizzamia / perfume-installing-and-import.js
Last active May 2, 2018 04:39
Perfume installing and import
// Install
npm install perfume.js --save-dev
// Importing library
// Import the generated bundle to use the whole library generated by this starter:
import Perfume from 'perfume.js';
// Import the transpiled modules from `dist/es` in case you have a modular library:
import Perfume from 'node_modules/perfume.js/dist/es/perfume';
@Zizzamia
Zizzamia / perfume-google-analytics.js
Last active January 15, 2018 00:21
Perfume google analytics
const perfume = new Perfume({
googleAnalytics: {
enable: true,
timingVar: "userId"
}
});
const perfume = new Perfume({
logPrefix: "🍻 Beerjs:"
});
perfume.start('fibonacci');
fibonacci(400);
const duration = this.perfume.end('fibonacci');
perfume.log('Custom logging', duration);
// 🍻 Beerjs: Custom logging 0.14 ms
@Zizzamia
Zizzamia / perfume-annotate-metrics-in-the-devtools.js
Last active January 15, 2018 00:12
Perfume.js: Annotate metrics in the DevTools
perfume.start('fibonacci');
fibonacci(400);
perfume.end('fibonacci');
// ⚡️ Perfume.js: fibonacci 0.14 ms
@Zizzamia
Zizzamia / perfume-first-contentful-paint.js
Last active January 14, 2018 23:50
Perfume.js: First Contentful Paint
const perfume = new Perfume({
firstContentfulPaint: true
});
// ⚡️ Perfume.js: First Contentful Paint 2029.00 ms
export class tasksList {
constructor(ElementRef: ElementRef) {
this.element = ElementRef.nativeElement;
}
// ...
ngOnDestroy() {
if (this.elLists) {
export class inputDueDate {
constructor(ElementRef: ElementRef) {
this.element = ElementRef.nativeElement;
}
ngOnInit() {
//this.elDueDateContainer = document.querySelector('.dueDatePopover-container'); REMOVED
this.elDueDateBadge = this.element.querySelector('.dueDate-badge');
//this.$elDueDateContainer = $(this.elDueDateContainer); REMOVED