Skip to content

Instantly share code, notes, and snippets.

Avatar
🪂

Ahmad Alhour aalhour

🪂
View GitHub Profile
@justanotherdot
justanotherdot / Dockerfile.bite_sized_networking
Last active May 20, 2022
A Dockerfile with (almost) all the tools mentioned in Bite Size Networking by Julia Evans
View Dockerfile.bite_sized_networking
# N.B. The only tool missing here that is mentioned in the document is `zenmap`
# purely because this image is intended to be run via a CLI and `zenmap` is a GUI
# to `nmap` i.e. one can play around with the tools by running:
#
# $ docker build --name bite_size_networking:latest .
# $ docker run --rm -d --name bsn_test bite_size_networking:latest
# $ docker exec -it bsn_test bash
#
# Alternatively, one can change the `ENTRYPOINT` to `["bash"]` and run:
#
View stackify.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ambivalentno
ambivalentno / test_client_fake_server.py
Created Nov 17, 2017
pytest-asyncio aiohttp client testing with fake server
View test_client_fake_server.py
import asyncio
import pathlib
import socket
import ssl
import pytest
import aiohttp
from aiohttp import web
from aiohttp.resolver import DefaultResolver
@seglberg
seglberg / grpc_asyncio.py
Last active Aug 30, 2022
gRPC Servicer with Asyncio (Python 3.6+)
View grpc_asyncio.py
import asyncio
from concurrent import futures
import functools
import inspect
import threading
from grpc import _server
def _loop_mgr(loop: asyncio.AbstractEventLoop):
View eca.py
#!/usr/bin/python
__author__ = "Nicolas Seriot"
__date__ = "2017-05-24"
# http://mathworld.wolfram.com/ElementaryCellularAutomaton.html
# https://en.wikipedia.org/wiki/Rule_110
import png
View avl.ml
(* Good morning everyone, I'm currently learning ocaml for one of my CS class and needed to implement
an avl tree using ocaml. I thought that it would be interesting to go a step further and try
to verify the balance property of the avl tree using the type system. Here's the resulting code
annotated for people new to the ideas of type level programming :)
*)
(* the property we are going to try to verify is that at each node of our tree, the height difference between
the left and the right sub-trees is at most of 1. *)
View Effective_Engineer.md

FWIW: I (@Rondy) am not the author of the content presented here, which is an outline from Edmond Lau's book. I've just copy-pasted it from somewhere and saved as a personal gist, before it got popular on newsnews.ycombinator.com. I don't remember where exactly the original source is from and neither could find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

View async_examples.py
import asyncio
import datetime
import random
async def display_date(num, loop):
end_time = loop.time() + 50.0
while True:
print("Loop: {} Time: {}".format(num, datetime.datetime.now()))
if (loop.time() + 1.0) >= end_time:
break
@jm3
jm3 / README.md
Last active Dec 27, 2021
Cognitive Bias Codex
View README.md