Skip to content

Instantly share code, notes, and snippets.

View pavi2410's full-sized avatar
:octocat:
Githubbing

Pavitra Golchha pavi2410

:octocat:
Githubbing
View GitHub Profile
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
const MAPPINGS = {
title: [1, 2, 0, 0],
// description: [1, 2, 72, 0, 1],
// descriptionHTML: [1, 2, 72, 0, 1],
summary: [1, 2, 73, 0, 1],
installs: [1, 2, 13, 0],
@pavi2410
pavi2410 / playground.rs
Created October 5, 2022 07:31 — forked from rust-play/playground.rs
DSL for Declarative UI library in Rust
macro_rules! run {
($a:expr) => {{
println!("{:?}", $a);
}};
}
#[derive(Debug)]
enum UiNode<'a> {
Window { content: &'a UiNode<'a> },
Column { content: Vec<UiNode<'a>> },
@pavi2410
pavi2410 / dense_timeline_plot.py
Created September 14, 2022 16:42
Dense Timeline plot
import pandas as pd
import matplotlib.pyplot as plt
import itertools
from datetime import datetime, timedelta
from matplotlib.patches import Patch
plt.figure(figsize=(30, 10), constrained_layout=True)
xscale = 3
sleep_start, sleep_end = 0.75, 1.375
package me.pavi2410.ui.theme
import androidx.compose.ui.graphics.Color
object TailwindColors {
val slate50 = Color(0xfff8fafc)
val slate100 = Color(0xfff1f5f9)
val slate200 = Color(0xffe2e8f0)
val slate300 = Color(0xffcbd5e1)
val slate400 = Color(0xff94a3b8)
@pavi2410
pavi2410 / skillhack.js
Last active November 17, 2021 20:17 — forked from digi0ps/skillhack.js
Hack for skillrack copy paste
// just call auto() in console for each problem in programming track.
// Use this extension to load this script
// https://microsoftedge.microsoft.com/addons/detail/koccodmekleicmjpnelamemnhkpbkibc
function solve(code) {
var editor_id = $(".ace_editor.ace_dark")[0].id;
var editor = ace.edit(editor_id);
editor.$blockScrolling = Infinity;
@pavi2410
pavi2410 / arp.c
Created October 3, 2021 17:08
Get MAC address using IP address via ARP using UDP sockets
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@pavi2410
pavi2410 / __rce_udp__.md
Last active September 23, 2021 05:37
Remote Command Execution (RCE) using UDP sockets in C

RCE using UDP

@pavi2410
pavi2410 / __udp_echo_server_client__.md
Last active August 11, 2021 06:09
UDP Echo Server-Client in C

UDP Echo Server-Client in C

@pavi2410
pavi2410 / __tcp_echo_server_client__.md
Last active August 10, 2021 15:53
TCP echo server-client

TCP Echo Server-Client in C

  • Works on Linux
  • Only single client can connect at a time
@pavi2410
pavi2410 / compose.py
Last active December 29, 2023 18:08
Implementation of Jetpack Compose like reactive tree structure in Python
from contextlib import contextmanager
# Helper methods
def pprint_dict(d):
return '[' + ', '.join([f'{k} = {d[k]}' for k in d]) + ']'
def composable_tree():