Skip to content

Instantly share code, notes, and snippets.

@madsalama
madsalama / Contributing.md
Created October 4, 2018 19:52 — forked from MarcDiethelm/Contributing.md
How to contribute to a project on Github

This text now lives at https://github.com/MarcDiethelm/contributing/blob/master/README.md. I turned it into a Github repo so you can, you know, contribute to it by making pull requests.


Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

@madsalama
madsalama / Makefile
Created September 29, 2018 10:27 — forked from vaclavbohac/Makefile
Example of threads in c.
# Vaclav Bohac (c) 2011
FLAGS = -D__USE_REENTRANT -lpthread
hthread: hello-thread.o
cc $(FLAGS) -o $@ $<
hello-thread.o: hello-thread.c
cc -o $@ -c $<
@madsalama
madsalama / unix_server.c
Created September 6, 2018 16:43 — forked from tscho/unix_server.c
An example of a unix socket echo server that can run as a daemon
#include <signal.h>
#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
#include <sys/un.h>
#include <errno.h>
#include <sys/signal.h>
#include <wait.h>
@madsalama
madsalama / unix_client.c
Created September 6, 2018 16:43 — forked from tscho/unix_client.c
Example unix socket client
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int sockfd, t, len;