Skip to content

Instantly share code, notes, and snippets.

View michael-nischt's full-sized avatar

Michael Nischt michael-nischt

View GitHub Profile
@michael-nischt
michael-nischt / dropbox
Last active August 29, 2015 13:57
server side dropbox
#!/bin/sh
### BEGIN INIT INFO
# Provides: dropbod
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Dropbox Service
### END INIT INFO
@michael-nischt
michael-nischt / VisionGL.java
Created June 2, 2011 18:37
Convert computer vision camera matrices to OpenGL
/*
* Copyright (c) 2011 Michael Nischt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@michael-nischt
michael-nischt / FpsCounter.java
Created August 17, 2011 16:33
A simple Frames-per-Second (FPS) counting utility class
/*
* Copyright (c) 2006 Michael Nischt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@michael-nischt
michael-nischt / InstanceProvider.java
Created March 18, 2012 19:17
Utility to fetch a reference for an instance mapped by a particular key.
/*
* Copyright (c) 2012 Michael Nischt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@michael-nischt
michael-nischt / glShaderUtils.js
Last active October 5, 2015 15:58
WebGL shader utilities
/*
* Copyright (c) 2011 Michael Nischt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@michael-nischt
michael-nischt / submat.m
Created July 19, 2012 00:10
accessing a sub-matrix of an unknown multi-dimensional matrix
% if ndims(A) == 3
% submat(A,i) = A(:,:,i)
% alternative use:
% submat(A,i:j) = A(:,:,i:j)
function B = submat( A, i )
s = size(A);
@michael-nischt
michael-nischt / grouped.m
Created July 19, 2012 00:10
creating record like data structures from arrays grouped by an index cell
function [ grouped ] = grouped( indices, varargin )
if iscell(indices)
I = indices;
else
I = grouped_indices( indices );
end
if isempty(varargin)
grouped = I;
@michael-nischt
michael-nischt / Simulation.java
Created July 26, 2012 08:34
Java class that performs a fixed rate simulation.
/*
* Copyright (c) 2012 Michael Nischt
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
package net.monoid.util;
import java.util.*;
/**
* based on:
* http://www.keithschwarz.com/darts-dice-coins/
* http://www.keithschwarz.com/interesting/code/?dir=alias-method
*/
public final class AliasMethod {
@michael-nischt
michael-nischt / touchmouse.js
Created February 20, 2016 10:37
Simple touch to (left) mouse click shim
// This is free and unencumbered software released into the public domain.
//
// Anyone is free to copy, modify, publish, use, compile, sell, or
// distribute this software, either in source code form or as a compiled
// binary, for any purpose, commercial or non-commercial, and by any
// means.
//
// In jurisdictions that recognize copyright laws, the author or authors
// of this software dedicate any and all copyright interest in the
// software to the public domain. We make this dedication for the benefit