Skip to content

Instantly share code, notes, and snippets.

View ankurparihar's full-sized avatar
💭
I may be slow to respond.

Ankur Parihar ankurparihar

💭
I may be slow to respond.
View GitHub Profile
@ankurparihar
ankurparihar / find-external-resources.js
Last active January 24, 2024 16:06
ChromeDevTools: Filter url not matching with domain
performance
.getEntries()
.filter(({entryType}) => entryType === "resource")
.map(p => p.name)
.filter(domain => !domain.match(new RegExp(`^${window.location.origin}`)))
@ankurparihar
ankurparihar / README-Template.md
Created August 10, 2020 08:29 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@ankurparihar
ankurparihar / RecordCanvas.js
Created August 3, 2020 11:51
Record canvas and save as mp4 (tested on Google Chrome)
// Source: https://medium.com/@amatewasu/how-to-record-a-canvas-element-d4d0826d3591
const canvas = document.getElementsByTagName('canvas')[0]
const videoStream = canvas.captureStream(30)
const mediaRecorder = new MediaRecorder(videoStream)
var chunks = []
mediaRecorder.ondataavailable = function (e) {
chunks.push(e.data)
}
var video = document.createElement('video')
@ankurparihar
ankurparihar / mp4togif.sh
Created August 2, 2020 13:47
ffmpeg convert mp4 to gif
ffmpeg -i input.mp4 -vf "fps=30" -loop 0 output.gif
@ankurparihar
ankurparihar / LuminousComponent.c
Created February 24, 2020 11:29
The development of the algorithm for the luminance component [Paper:Novel Histogram Processing for Colour Image Enhancement]
#include <stdio.h>
float H(int); // Histogram data function
int value = 0; // color value [0-255] used in result
int result[255]; // store the ranges
int max_recursion = 8; // 8 recursion as mentioned in paper 2^8 = 256 intervals
/**
* Find intermediate cut C for which sum(H[start-C]) is equal to sum(H[C-end])
* for a given range
/*----- Find host name from IP address -----*/
#include <stdio.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
int main(int argc, char* argv[]){
struct hostent* hent; // host structure