Skip to content

Instantly share code, notes, and snippets.

View Bhupesh-V's full-sized avatar
🤔
Do I know what I am doing? No

Bhupesh Varshney Bhupesh-V

🤔
Do I know what I am doing? No
View GitHub Profile
@tebeka
tebeka / httpd.go
Created February 15, 2024 13:40
Monitoring number of open files on Linux in Go
package main
import (
"expvar"
"fmt"
"log/slog"
"net/http"
"os"
"time"
{
description = "A very basic flake";
inputs = {
ugit-src = {
url = "github:Bhupesh-V/ugit";
flake = false;
};
flake-utils = {
url = "github:numtide/flake-utils";
@carlosonunez
carlosonunez / Dockerfile
Last active February 4, 2024 15:47
ugit, but even smaller!
FROM alpine:3.18 as base
ENV ESSENTIAL="tar sh"
ENV DEPS="ugit git fzf tput nl cut bash sed awk tr env xargs"
RUN apk add --no-cache \
bash \
coreutils \
git \
ncurses \
ncurses-terminfo \
@debasishg
debasishg / cache-oblivious.md
Last active April 12, 2024 18:22
Papers related to cache oblivious data structures

Cache Oblivious and Cache Aware Data Structure and Algorithms

  1. Cache-Oblivious Algorithms and Data Structures - Erik Demaine (One of the earliest papers in cache oblivious data structures and algorithms that introduces the cache oblivious model in detail and examines static and dynamic cache oblivious data structures built between 2000-2003)

  2. Cache Oblivious B-Trees - Bender, Demaine, Farch-Colton (This paper presents two dynamic search trees attaining near-optimal performance on any hierarchical memory. One of the fundamental papers in the field where both search trees discussed match the optimal search bound of Θ(1+log (B+1)N) memory transfers)

  3. Cache Oblivious Search Trees via Binary Trees of Small Height - Brodal, Fagerberg, Jacob (The data structure discussed in this paper works on the version of [2] but avoids the use o

@IshaanAdarsh
IshaanAdarsh / GSoC ’23 Project-Report.md
Last active March 18, 2024 09:19
Google Summer of Code 2023 (PostgreSQL)

Google Summer of Code 2023 Final Work Product


gsoc


Introduction

How debuggers work

Writing this post in response to the WeekendDevPuzzle of 2022-01-15. This thread has a bunch of submissions, and it's insightful to go over how we often think about debuggers. I'll be linking this post to this twitter thread, which may also contain some follow up twitter follow ups later.

On Linux

Let's start with a simple piece of code. This is the program we'll be debugging. As you can see, it's a fairly simple piece of code. We will be setting a breakpoint on the crashtest function, crashing the debugger and seeing what happens.

Let's start with running this program (we've compiled using gcc -o testdebugcrash testdebugcrash.c). We'll be running this on Linux for now (the importance of this will be understood later). ![start-program](https://user-images.githubusercontent.com/1546858/149652729-dbfa2104-a

@diki-haryadi
diki-haryadi / Handling Null SQL in Golang
Created December 15, 2021 10:59
Handling Null SQL in Golang
```
package helper
import (
"database/sql"
"encoding/json"
"fmt"
"reflect"
"time"
@kad1r
kad1r / clean_code.md
Created November 9, 2021 05:24 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@Animesh-Ghosh
Animesh-Ghosh / recursive_ctes.sql
Created July 25, 2021 12:08
Recursive Common Table Expressions
-- count till n
WITH RECURSIVE count_cte AS (
SELECT 1 AS n -- anchor member
UNION
SELECT n + 1 -- recursive member
FROM count_cte WHERE n < 10
) SELECT * FROM count_cte;
-- factorial
WITH RECURSIVE fact_cte AS (
@vitalizzare
vitalizzare / __init__.py
Created December 27, 2020 01:24
Split module into multiple files
from .social_media_post import SocialMediaPost
from .social_media_post_publisher import SocialMediaPostPublisher
# This is used by 'from socsocial_media_post import *'
# As far as there is nothing else here and in app.py
# we import the classes explicitely, this part can be ommited
__all__ = [
'SocialMediaPost',
'SocialMediaPostPublisher'
]