Skip to content

Instantly share code, notes, and snippets.

View s311354's full-sized avatar
๐Ÿ€
I may be slow to respond.

Louisliu s311354

๐Ÿ€
I may be slow to respond.
View GitHub Profile
@leimao
leimao / graph.py
Last active December 15, 2022 09:15
Graph Traversal
from typing import Iterable, List, Union, Set
class Graph:
def __init__(self) -> None:
# Adjacency set representation.
# key: node name, value: adjacency node name set.
self.edges = dict()
@jirihnidek
jirihnidek / getaddrinfo_example.c
Last active February 9, 2025 12:12
Example of getaddrinfo() program.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
int
lookup_host (const char *host)
@brghena
brghena / .bashrc
Last active September 15, 2024 14:44
Sensible git submodules
# make git submodules usable
# This overwrites the 'git' command with modifications where necessary, and
# calls the original otherwise
git() {
if [[ $@ == clone* ]]; then
gitargs=$(echo "$@" | cut -c6-)
command git clone --recursive $gitargs
elif [[ $@ == pull* ]]; then
command git "$@" && git submodule update --init --recursive
elif [[ $@ == checkout* ]]; then