Skip to content

Instantly share code, notes, and snippets.

View s-alad's full-sized avatar
🐈‍⬛

s-alad

🐈‍⬛
View GitHub Profile
@steveherrin
steveherrin / main_aiocache.py
Created January 11, 2024 19:38
Minimal demo of using aiocache with FastAPI
"""
caching test/demo
first:
pip install fastapi aiocache "uvicorn[standard]"
"""
import asyncio
import contextlib
import json
import logging
@faaaaabi
faaaaabi / synapse-postgres-docker-compose.md
Last active May 23, 2025 10:04
A basic setup for synapse with postgres behind a nginx reverse proxy

Synapse Docker Compose Setup

This proposed setup assumes that you want to use synapse with a Postgres database behind a separate nginx reverse proxy for TLS.

Setup

DNS setup

A detailed explanation of a basic and extended dns setup can be found here

Generate synapse config

@bmaupin
bmaupin / free-database-hosting.md
Last active May 29, 2025 17:53
Free database hosting
@abcdabcd987
abcdabcd987 / prog2_gbn.c
Created April 28, 2017 03:12
Programming Assignment #2: Implementing a Reliable Transport Protocol (Go-Back-N)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* ******************************************************************
ALTERNATING BIT AND GO-BACK-N NETWORK EMULATOR: VERSION 1.1 J.F.Kurose
This code should be used for PA2, unidirectional or bidirectional
data transfer protocols (from A to B. Bidirectional transfer of data
is for extra credit and is not required). Network properties:
@lilyball
lilyball / sieve.ml
Created August 23, 2008 03:35
An implementation of the Sieve of Eratosthenes in OCaml
type primality = Prime | Composite | Unknown
type sieve = primality array
exception Out_of_bounds
let make n =
if n < 2 then invalid_arg "Sieve.make"
else
let sieve = Array.make n Unknown in
sieve.(0) <- Composite;
sieve.(1) <- Composite;