Skip to content

Instantly share code, notes, and snippets.

View akanshgulati's full-sized avatar
🏠
Working from home

Akansh Gulati akanshgulati

🏠
Working from home
View GitHub Profile
@akanshgulati
akanshgulati / Performance Measure
Created June 18, 2019 05:56
Get average performance of server from KeyCDN performance tool
(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 / keycdn-script.js
Last active June 9, 2019 19:21
Script to extract perf results from KeyCDN
// 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 / tasks.md
Last active August 9, 2024 23:16
Visual Studio Code task to compile and run C programs

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.