Skip to content

Instantly share code, notes, and snippets.

View davidfoerster's full-sized avatar

David Foerster davidfoerster

  • Berlin, Germany
View GitHub Profile
#!/usr/bin/python3
import sys, os, os.path
for original_name in sys.argv[1:]:
original_name_noext, extension = os.path.splitext(original_name)
new_name = original_name_noext[:-11] + extension
print('{0!r} => {1!r}'.format(original_name, new_name))
if os.path.exists(new_name):
reply = None
import java.io.InputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
class FPxToFloatClass
{
/**
* Converts a series of bytes in an FP*-like format to a native floating-
* point type.
Migrated to https://github.com/davidfoerster/apt-remove-duplicate-source-entries
@davidfoerster
davidfoerster / global.js
Created September 29, 2015 22:15
Chromatik files (2015/09/30)
window["colorElements"] = {
"frontColors" : ["f8c5c5","f8dfc5","f8f8c5","dff8c5","c5f8c5","c5f8df","c5f8f8","c5dff8","c5c5f8","dfc5f8","f8c5f8","f8c5df","f28c8c","f2bf8c","f2f28c","bff28c","8cf28c","8cf2bf",
"8cf2f2","8cbff2","8c8cf2","bf8cf2","f28cf2","f28cbf","eb5252","eb9f52","ebeb52","9feb52","52eb52","52eb9f","52ebeb","529feb","5252eb","9f52eb","eb52eb","eb529f",
"e51919","e57f19","e5e519","7fe519","19e519","19e57f","19e5e5","197fe5","1919e5","7f19e5","e519e5","e5197f","ac1313","ac5f13","acac13","5fac13","13ac13","13ac5f",
"13acac","135fac","1313ac","5f13ac","ac13ac","ac135f","720c0c","723f0c","72720c","3f720c","0c720c","0c723f","0c7272","0c3f72","0c0c72","3f0c72","720c72","720c3f",
"390606","391f06","393906","1f3906","063906","06391f","063939","061f39","060639","1f0639","390639","39061f","ffffff","e9e9e9","d4d4d4","bfbfbf","aaaaaa","949494","7f7f7f","6a6a6a",
"555555","3f3f3f","2a2a2a","151515"],
"frontColors_group" : {
"f8c5c5" : "Red","f28c8c" : "Red","eb5252" : "Red","e51919" : "Red"
@davidfoerster
davidfoerster / triangle_strip.pde
Created April 9, 2015 14:34
triangle_strip.pde
int x;
int y;
float outsideRadius = 150;
float insideRadius = 100;
void setup()
{
size(640, 360);
background(204);
//3D Spectrogram with Microphone Input
//Modified by kylejanzen 2011 - https://kylejanzen.wordpress.com
//Based on script wwritten by John Locke 2011 - http://gracefulspoon.com
//Output .DXF file at any time by pressing "r" on the keyboard
import processing.dxf.*;
import ddf.minim.analysis.*;
import ddf.minim.*;
@davidfoerster
davidfoerster / character-distribution.c
Created April 3, 2015 14:17
Perform a simple statistical analysis of arbitrary byte streams
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <sysexits.h>
inline static double square(double x)
// imports of all embedded sketched
...
// global variables of embedding sketch
...
// global variables of Movie sketch
...
// global variables of Background sketch
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.