Skip to content

Instantly share code, notes, and snippets.

View Dekker1's full-sized avatar

Jip J. Dekker Dekker1

View GitHub Profile
@Dekker1
Dekker1 / gantt_example.mzn
Created July 11, 2022 00:27
Example of Gantt visualisations in the MiniZinc standard library
include "output/gantt.mzn";
include "ide/vis.mzn";
set of int: Tasks = 1..10;
array[Tasks] of var 1..1440: start;
array[Tasks] of int: dur = [35 | i in Tasks];
constraint forall(i,j in Tasks where i > j) (if i mod 2 == 0 then start[i] + dur[i] < start[j] else start[i] + 16 < start[j] endif);
output [ show_gantt(start, dur) ];
constraint vis_gantt(start, dur);
@Dekker1
Dekker1 / Dockerfile
Created May 13, 2022 00:26
MiniZinc Python Example Docker
FROM minizinc/minizinc:latest-alpine
RUN apk add --update --no-cache python3 py3-pip
RUN pip3 install --no-cache-dir minizinc
COPY basic_example.py /usr/local/bin/basic_example.py
ENTRYPOINT ["/usr/local/bin/basic_example.py"]
@Dekker1
Dekker1 / init.vim
Created October 25, 2016 09:45
Neovim configuration (Should I ever want to try again)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Dein.vim initialisation
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if &compatible
set nocompatible
endif
set runtimepath+=~/.config/nvim/repos/github.com/Shougo/dein.vim
call dein#begin(expand('~/.config/nvim/'))
@Dekker1
Dekker1 / Timer.cpp
Last active October 21, 2015 15:25
A simple timer for C++ based programs
//
// Created by Jip J. Dekker on 05/10/15.
//
#include "Timer.h"
void Timer::start() {
if (output) cout << "\t Start Application"<< endl;
app.start = high_resolution_clock::now();
}
@Dekker1
Dekker1 / Makefile
Last active August 29, 2015 14:09
Gecode Makefile OSX
# A simple and basic Makefile build script for Gecode for Mac OSX.
#
# Author:
# Jip J. Dekker <jip@dekker.li>
# Based on similar makefile for linux by Georgios Petrousis <gpetrousis@gmail.com>
#
# Updated on: 9/11/2014
#
# Feel free to distribute this file to anyone.
# Please contact me for any corrections and suggestions.
@Dekker1
Dekker1 / kill.fish
Created May 5, 2014 22:00
Functions for F-shell. Drop an F-bomb, kill a process
function flip
echo "$argv[1]" | perl -C3 -Mutf8 -lpe '$_=reverse;y/a-zA-Z.['\'',({?!\"<_;‿⁅∴\r/ɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎzɐqɔpǝɟƃɥıɾʞ|ɯuodbɹsʇnʌʍxʎz˙],'\'')}¿¡,>‾؛⁀⁆∵\n/'
end
function fuck
set -l CMD "pkill"
which $CMD >/dev/null; or set -l CMD "killall"
echo
if [ $argv[1] = "off" ]
set FLIP ' (ノಠ益ಠ)ノ彡' '(ノಠ-ಠ)ノ彡'
@Dekker1
Dekker1 / .zlogin
Last active August 29, 2015 13:58
.zlogin and config.fish for public key authentication on computer with encrypted home folder (will prompt for password if home folder not yet decrypted)
if test -e $HOME/.ecryptfs/auto-mount; then
mount | grep "$HOME type ecryptfs"
if test $? != 0; then
ecryptfs-mount-private
cd $HOME
source ~/.zshrc
fi
fi