Skip to content

Instantly share code, notes, and snippets.

View w3dg's full-sized avatar
:fishsticks:

Debopam Gupta w3dg

:fishsticks:
View GitHub Profile
color-link default "#e0e0e0,#1d1f21"
color-link comment "#969896,#1d1f21"
color-link constant "#de935f,#1d1f21"
color-link identifier "#8abeb7,#1d1f21"
color-link type "#e0e0e0,#1d1f21"
color-link statement "#b294bb,#1d1f21"
color-link constant.number "#dc9656,#1d1f21"
color-link constant.string "#b5bd68,#1d1f21"
color-link brightgreen "#81a2be,#1d1f21"
@w3dg
w3dg / google-youtube-2023-subscriptions-csv-to-newpipe-prev-export-json.go
Created February 6, 2024 18:09
google youtube 2023 subscriptions csv to newpipe previous export json format
// https://github.com/TeamNewPipe/NewPipe/issues/8040
// From https://github.com/TeamNewPipe/NewPipe/issues/8040#issuecomment-1445220859
// Go plaground with the file https://go.dev/play/p/IvJ88tFeNk1
// Convert from google/youtube's current (Feb 2023) CSV format into something that Newpipe can import as a 'previous export' format.
// YMMV, no guarantees, use at your own risk, don't run with scissors, objects in mirror are smaller than they appear. All that jazz.
// CostaRich
package main
@w3dg
w3dg / count_test.v
Created December 1, 2023 08:39
0,1,2,4,6 Mod 5 Skip Counter Using D Flip Flops
`timescale 1ns / 1ps
// Design a counter with D flip-flops that goes through the following binary repeated
// sequence 0,1,2,4,6
module count_test();
reg clk;
reg rst;
wire q2, q1, q0;
@w3dg
w3dg / sorts.c
Last active November 29, 2023 21:02
Merge Sort and Quick Sort working code
#include <stdio.h>
#include <stdlib.h>
void swap(int *a, int *b)
{
int t;
t = *a;
*a = *b;
*b = t;
}

Binary - the basis of Computing

Binary : Base 2 Number System Two States: ON or OFF, 1 or 0, true or false, high voltage or low voltage

Binary Numbers

In traditional decimal system, 10's place is used. In Binary System 2's place is used.


#include <stdio.h>
// Pascal's Triangle
// given a number print pascal's triangle upto that number
int factorial(int);
int combination(int, int);
int main() {
int n;
#!/usr/bin/env bash
BING_WALLPAPER_URL="https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1"
TODAYS_URL=$(curl -s $BING_WALLPAPER_URL | jq | grep '"url":' | cut -d':' -f2 | tr -d '"' | tr -d ',' | tr -d ' ')
wget https://bing.com$TODAYS_URL -O wallpaper_$(date --iso-8601).jpg
#!/bin/bash
# I use it for C development / learning
# Find all executables, dont match files under .git, dont kill this script itself, "nerf.sh", xargs for rm on all
find . -type f -executable | grep --invert-match "git" | grep --invert-match "nerf.sh" | xargs rm 2>/dev/null

Inheritance And Interfaces Notes

Advantages:

  • Code reusability
  • Gives the capability to express the inheritance relationship

Different forms

  1. Single inheritance