Skip to content

Instantly share code, notes, and snippets.

View pampas93's full-sized avatar
🎯
Focusing

Abhijit Srikanth pampas93

🎯
Focusing
View GitHub Profile
@pampas93
pampas93 / video-metrics.js
Last active October 6, 2023 09:13
Use this js to overlay text on any video within the webpage - to show Resolution, DRM info - every frame
setTimeout(async () => { await videoMetrics() }, 7000);
async function videoMetrics() {
console.log('Testing from the video-metrics extension');
// L3 DRM
const isL3DRM = await (
navigator.requestMediaKeySystemAccess &&
navigator.requestMediaKeySystemAccess('com.widevine.alpha', [{
videoCapabilities: [
@pampas93
pampas93 / test.csv
Last active November 21, 2022 20:31
UserID Name
U0008 Abhi
U0010 Test
U0005 Steve
@pampas93
pampas93 / package.nuspec
Last active April 6, 2020 05:58
nuspec file for the SimpleLib NuGet package
<?xml version="1.0" encoding="utf-8"?>
<package >
<metadata>
<id>pampas93.simpleLib</id>
<version>1.0.2</version>
<authors>Abhijit Srikanth</authors>
<owners>Abhijit Srikanth</owners>
<license type="expression">MIT</license>
<description>Simple Calculator lib DLL</description>
<projectUrl>https://github.com/pampas93/NuGet-Experiments/tree/master/SimpleLib</projectUrl>
/////////// Property (setter) Injection ///////////
public class Car {
// Dependency Injection using Property setter
public IEngine Engine { get; set; }
public void StartEngine() {
Engine.Start();
}
}
@pampas93
pampas93 / Car2.cs
Last active February 24, 2020 16:16
public class Car {
private IEngine _engine;
// Dependency Injection using Constructors
public Car(IEngine engine) {
_engine = engine;
}
public void StartEngine() {
_engine.Start();
@pampas93
pampas93 / Car.cs
Last active February 24, 2020 07:28
Bad design (explaining Dependency Injection)
public class Car {
private CombustionEngine _engine;
public Car(CombustionEngine engine) {
_engine = engine;
}
public void StartEngine() {
_engine.Start();
}
public void ShowMeExpadoObject(string input)
{
dynamic dynamicObj = new ExpandoObject();
// Let's assume the input is of type string and we are traversing through
// each line, process it into getting key and value inside the for-each
foreach (string line in input)
{
// After processing the line, we get key and value, where
<html>
<head>
<style>
html,
body {
margin: 0 !important;
padding: 0 !important;
}
@pampas93
pampas93 / nginx.conf
Created April 13, 2019 14:23
Nginx configuration file to run Socket.io project
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
@pampas93
pampas93 / BarSchemaValidator.py
Last active July 24, 2017 19:09
Python script to check if a JSON string can be mapped into a Bar graph. To do so, Have to first validate for the schema. A part of a bigger project.
import json
import numbers
import jsonschema
from jsonschema import validate
import sys
######################################################################
## Abhijit Srikanth ##
## Validate if a Json string can be plotted againt Bar Graph for ##
## the given schema. ##