Skip to content

Instantly share code, notes, and snippets.

@dasuxullebt
dasuxullebt / benchmark.hs
Last active October 24, 2017 16:33
Simple Benchmark Tool
{-
A simple program that calls the `time` command on a given command,
parses the output, the required time and space, and puts it into a
given SQLite database.
Requires persistent, persistent-template, persistent-sqlite
Invoke with:
Require Import Coq.Vectors.Vector.
Require Import Program.
Notation vec := Vector.t.
Notation Vnth := Vector.nth.
Notation Vnil := (@Vector.nil _).
Notation Vcons := (@Vector.cons _).
Notation Vmap := Vector.map.
Notation fin_rect2 := Fin.rect2.
/*
* Copyright 2016 (C) Christoph-Simon Senjak
*
* Mail: System.out.println(new StringBuilder("ed" + "." + "luxu" + "@" + "ssc").reverse().toString());
*/
import java.io.IOException;
import javax.imageio.ImageIO;
import java.io.File;
import java.awt.image.BufferedImage;
@dasuxullebt
dasuxullebt / spacepins.c
Created January 21, 2016 19:07 — forked from anonymous/spacepins.c
spacepins
/*
char m[] = "Copyright (c) 2016, Christoph-Simon Senjak";
printf("%s <%c%c%c%c%s%c>\n", m, m[11], m[24], m[24], '@', "uxul.d", m[37]);
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
@dasuxullebt
dasuxullebt / listinigs.py
Created January 9, 2016 16:03
listings with labels instead of raw line numbers for latex (hack)
#!/usr/bin/env python
# This file defines a simple mechanism to use labels in source code,
# rather than raw line numbers, for the lstinputlisting-command in
# latex. Use the format
#
# \lstinputlisting[firstline=LABEL1, lastline=LABEL2, ...]{filename}
#
# especially, firstline and lastline must be the first two
# arguments. In your sourcecode, you simply add a comment containing
@dasuxullebt
dasuxullebt / pcmwav.h
Created April 6, 2014 22:59
Add WAV-header to PCM data
/* Save 16 bit PCM 44.1kHz stereo data into a WAV-File, so common media
players will recognize it.
*/
#pragma once
#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>