Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Akansh Gulati akanshgulati

🏠
Working from home
View GitHub Profile
@akanshgulati
akanshgulati / keycdn-script.js
Last active Jun 9, 2019
Script to extract perf results from KeyCDN
View keycdn-script.js
// Calculates the average of TTFB from various locations of the
// KeyCDN server using its performance tool - https://tools.keycdn.com/performance
// Paste this script in the console after getting the performance test of a url
(function () {
const TTFBIndex = 8
// Get all the rows of the performance table and remove the first heading row from it;
const rows = Array.from(document.querySelector(`#perfResult`).children[1].tBodies[0].children).slice(1);
// calculating sum of the values
@akanshgulati
akanshgulati / Performance Measure
Created Jun 18, 2019
Get average performance of server from KeyCDN performance tool
View Performance Measure
(function () {
const TTFBIndex = 8
const rows = Array.from(document.querySelector(`#perfResult`).children[1].tBodies[0].children).slice(1)
const sum = rows.reduce((acc, row) => {
var text = row.children[TTFBIndex].innerText
if (text.indexOf(`ms`) > -1) {
// if result is in seconds
acc += parseFloat(text)
} else if (text.indexOf(`s`) > -1) {
@akanshgulati
akanshgulati / tasks.md
Last active Mar 3, 2021
Visual Studio Code task to compile and run C programs
View tasks.md

Introduction

The below code is the configuration for the Microsoft Visual Code tasks which will enable you to compile and run C program

Steps

  1. Press Cmd + Shift + P
  2. Type Configure task ( A task.json file will be created for that project )
  3. Copy below configuration code and save it.

Usage

Simple press Cmd + Shift + B to compile and run.

Note: Make sure you select the tab having C program as below tasks run on active tab in VS Code.