Skip to content

Instantly share code, notes, and snippets.

View anthonyraf's full-sized avatar

Anthony Rafidison anthonyraf

View GitHub Profile
@stefan-wolfsheimer
stefan-wolfsheimer / Socket-C++.md
Created November 1, 2019 10:45
Socket programming pattern C++

Makefile

CPP=g++ -std=c++14

all:server client
	echo "ok"

server: server.cpp config.h socket.o 
	${CPP} server.cpp socket.o -o server
@hbsdev
hbsdev / clean_py.sh
Last active July 14, 2024 19:48 — forked from joelverhagen/clean_py.sh
Recursively remove all .pyc files and __pycache__ directories in the current directory.
#!/bin/sh
# recursively removes all .pyc files and __pycache__ directories in the current
# directory
find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf
@FedericoPonzi
FedericoPonzi / socket_portable.c
Last active March 8, 2024 01:36
C sockets portable in windows/linux example
// As seen on http://www.di.uniba.it/~reti/LabProRete/Interazione(TCP)Client-Server_Portabile.pdf
#if defined WIN32
#include <winsock.h>
#else
#define closesocket close
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif
#include <stdio.h>
@averagesecurityguy
averagesecurityguy / Makefile
Last active January 15, 2023 09:44
Cython Shell Example
CC=gcc
INCLUDE=/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
LINK=python2.7
FILE=shell
$(FILE): $(FILE).c
$(CC) $(FILE).c -I$(INCLUDE) -l$(LINK) -o $(FILE)
$(FILE).c:
cython --embed $(FILE).pyx