Skip to content

Instantly share code, notes, and snippets.

View Leandros's full-sized avatar
🦀
Available for Rust contracting

Arvid Gerstmann Leandros

🦀
Available for Rust contracting
View GitHub Profile
/*
* Compile with re2c:
* $ re2c main.cpp -o main.re2c.cpp --nested-ifs --bit-vectors --utf-8 --no-debug-info
* $ g++ -std=c++17 -O3 -o test_re2c main.re2c.cpp
*/
#include <iostream>
#include <fstream>
bool
@Leandros
Leandros / Makefile
Last active January 8, 2022 23:18
Minimal C++ Makefile
CC = clang++
CXX = clang++
DEBUG = -ggdb -O1 -march=native
RELEASE = -O2
CPPFLAGS := -I.
CXXFLAGS := $(DEBUG) -W -Wall -Wextra -std=c++17
LDLIBS := -lm
OUTPUT_OPTION = -MMD -MP -o $@ -MJ [email protected]
# Modify your C++ filesuffix here:
@Leandros
Leandros / compresspdf.sh
Created April 2, 2019 08:55
Compress PDF (requires ghostscript)
#!/bin/bash
readonly input="$1"
readonly output="$2"
readonly preset="$3"
if [ "$input" = "" ] || [ "$output" = "" ] || [ "$preset" = "" ]; then
echo "usage: $0 [input file] [output file] [screen|ebook|printer|prepress]"
exit 1
fi
#!/bin/bash
#
# UPTIME MONITORING
# v1.0.0
#
### INSTALLATION
#
# 1. Install dependencies
#
# `apt-get install mailx curl openssl`