Skip to content

Instantly share code, notes, and snippets.

@zebreus
zebreus / INSTALL
Last active September 2, 2019 13:17
Certificate Generator Installationsanleitung
#!/bin/bash
## Instalationsanleitung webdemo
### Schritt 0: docker und docker-compose installieren
### Schritt 0.5: Sicherstellen, dass der Nutzer auf docker zugreifen darf. Dazu den Nutzer zur Gruppe docker hinzufügen.
### Schritt 1: Repos clonen
git clone --recursive https://github.com/Zebreus/webClient.git
git clone https://github.com/Zebreus/certificate-generator.git
### Schritt 2: WebClient erstellen.
cd webClient
@zebreus
zebreus / import.sh
Last active October 6, 2020 13:21 — forked from whistler/import.sh
Copy files to another repository while saving git history
# copied from http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/
git clone <git repository A url> # clone source repository
cd <git repository A directory>
git remote rm origin # to make sure it doesn't affect the original repository
git filter-branch --subdirectory-filter <directory 1> -- --all # remove all files other than the ones needed
mkdir <directory 1> # move them into another directory where they will be stored in the destination repository (if needed)
mv * <directory 1>
git add .
git commit
#include <iostream>
void main(){
std::cout << "Hello world" << std::endl;
}
@zebreus
zebreus / kakuro.pl
Last active April 15, 2021 12:47
A simple kakuro solver using clp in prolog
:- use_module(library(clpfd)).
% A simple test kakuro
kakuroValues1(Configuration, Values) :-
Configuration = [
[21,[A1,A2,A3]],
[11,[B1,B2,B3]],
[10,[C1,C2,C3]],
[23,[A1,B1,C1]],
[12,[A2,B2,C2]],
@zebreus
zebreus / screenHolder.scad
Created May 31, 2021 10:22
An alternative bracket for a defender Carholder 202
// An alternative extension for a defender carholder 202
holderHeight = 40;
holderLength = 100;
thickness = 2.5;
ballRadius = 10.5;
beamSize = (ballRadius+thickness)*2;
beamHoleLength = 40;
holeRadius = 8.5;
ballCylinderLength = 5;
@zebreus
zebreus / moveScript.sh
Last active June 13, 2022 13:36
Move files to another git repository without losing their history
#!/bin/bash
# Specify source repo
SOURCE_REPO="git@github.com:Zebreus/pruefungsplaner-scheduler.git"
SOURCE_BRANCH="master"
CREATE_TEMP_SOURCE_DIRECTORY=false
CLONE_SOURCE_REPO=true
SOURCE_REPO_DIRECTORY_NAME="source"
SOURCE_REPO_DIRECTORY="."
@zebreus
zebreus / Readme.md
Last active November 15, 2022 22:46

A list of bakeries in germany

Scraped on 15.11.2022 from https://www.innungsbaecker.de

Contains 21905 bakeries

Extract a newer list

To use the script clone this into a folder and run

@zebreus
zebreus / Readme.md
Last active November 15, 2022 23:25
csv list of bookstores in germany

A list of bookstores in germany

Scraped on 15.11.2022 from https://www.buchhandlung-finden.de , they probably got their data from somewhere else

Extract a newer list

To use the script clone this into a folder and run

npm install
npm run download
@zebreus
zebreus / Readme.md
Last active June 28, 2023 19:26
Really hacky workaround for highlightjs in asciidoctor-web-pdf / paged.js

Really hacky script for fixing listings with highlightjs in asciidoctor-web-pdf / paged.js

Add this script as docinfo-footer-pdf.html to your project and add the following to the top of your asciidoc file:

ifdef::env-web-pdf[]
:docinfo: shared-footer
endif::env-web-pdf[]
@zebreus
zebreus / style-enforcer.sh
Last active January 12, 2024 20:43
Bash pre-commit hook for the incremental adoption of code-formatting in large software projects
#!/usr/bin/env bash
# # Overview
# The goal of the enforce-style script is to make sure that submitters run clang-format before submitting a patch. It does not enforce styling for existing manually formatted files, but will enforce that NEW/MANAGED files that are staged when committing are formatted with clang-format. This way we can incrementally adopt clang-format.
#
# # Managed files
# Managed files are those whose styling is managed by this script. This means that the styling is enforced for these files. A precommit-hook will automatically format these files and stage the result. Gerrit will also automatically format these files and stage the result.
#
# # Incremental adoption
# This script is designed for incremental adoption of styling. It achieves this by differentiating between managed (styling enforced) and ignored (styling not enforced) files. Initially all existing files were added to the list of ignored files. When a staged file matches the clang-format style, it is automatically removed from the