Skip to content

Instantly share code, notes, and snippets.

View Jammyjamjamman's full-sized avatar
👻

James Sherratt Jammyjamjamman

👻
  • Alpha Centauri
View GitHub Profile
@Jammyjamjamman
Jammyjamjamman / Makefile
Last active June 23, 2022 20:40
Dead simple makefile (in this case for building openssl bins).
# CC = gcc # Optional. Will use system default if not given here e.g. gcc or clang.
CFLAGS = -g -Wall -fanalyzer $(shell pkg-config --cflags openssl)
LIBS=$(shell pkg-config --libs openssl)
LDFLAGS = $(LIBS)
bins = decrypt_file encrypt_file
all: $(bins)
clean:
@for file in $(bins); do \
@Jammyjamjamman
Jammyjamjamman / Makefile
Last active December 10, 2022 07:29
makefile example #2
# Another simple make example. Creates 2 bins which include the same c file.
# Assumes e.g. you have main.c, main2.c, mylib.c and mylib.h.
# CC = gcc # Optional. Will use system default if not given here e.g. gcc or clang.
CFLAGS = -g -Wall -fanalyzer # $(shell pkg-config --cflags openssl)
# LIBS=$(shell pkg-config --libs openssl)
# LDFLAGS = $(LIBS)
bins = myprogram1 myprogram2
all: $(bins)

Elderberry and Blackberry Wine

Ingredients

3.5kg fruit, ~50:50 elderberries and blackberries.

2.1kg sugar

#include <stdio.h>
#include <stdlib.h> // Include stdlib for malloc and free
#include <limits.h>
#include <stdbool.h>
#include <string.h>
void sieve_of_eratosthenes(unsigned long n) {
// Dynamically allocate memory for the prime array on the heap
bool *prime = (bool *)malloc((n + 1) * sizeof(bool));
if (!prime) {