Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Akansh Gulati akanshgulati

🎯
Focusing
Block or report user

Report or block akanshgulati

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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 / 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 / tasks.md
Last active Feb 1, 2019
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.

You can’t perform that action at this time.