Skip to content

Instantly share code, notes, and snippets.

@Hodapp87
Hodapp87 / vtk_python_mesh.py
Created February 8, 2014 00:49
Simple VTK example in Python to load an STL mesh and display with a manipulator.
#!/bin/env python
"""
Simple VTK example in Python to load an STL mesh and display with a manipulator.
Chris Hodapp, 2014-01-28, (c) 2014
"""
import vtk
def render():
@Hodapp87
Hodapp87 / jpeg_split.c
Last active December 27, 2017 02:10
Write each scan from a multi-scan/progressive JPEG.
// jpeg_split.c: Write each scan from a multi-scan/progressive JPEG.
// This is based loosely on example.c from libjpeg, and should require only
// libjpeg as a dependency (e.g. gcc -ljpeg -o jpeg_split.o jpeg_split.c).
#include <stdio.h>
#include <jerror.h>
#include "jpeglib.h"
#include <setjmp.h>
#include <string.h>
void read_scan(struct jpeg_decompress_struct * cinfo,
# Contributor: Rick W. Chen <stuffcorpse at archlinux dot us>
pkgname=msp430-libc
pkgver=20120224
pkgrel=2
pkgdesc="C runtime library for the MSP430 family of microcontrollers"
arch=('i686' 'x86_64')
url="http://mspgcc4.sourceforge.net/"
license=('custom')
depends=('gcc-msp430')
# Contributor: Rick W. Chen <stuffcorpse at archlinux dot us>
pkgname=gcc-msp430
pkgver=4.6.3
pkgrel=4
pkgdesc="GNU toolchain for the TI MSP430 processor"
arch=('i686' 'x86_64')
url="http://sourceforge.net/projects/mspgcc/"
license=('GPL')
makedepends=('gcc46' 'binutils-msp430')
@Hodapp87
Hodapp87 / subprocess_example
Created April 4, 2014 20:50
subprocess with string to stdin
# Will require changes (due to how strings are handled) on Python 3.x
import subprocess
f = open("test.jpg")
jpegString = f.read()
ret = subprocess.Popen(["./jpeg_check.o", "-"], stdin = subprocess.PIPE)
ret.communicate(jpegString)
print(ret.returncode)
@Hodapp87
Hodapp87 / sound_plots.py
Created March 7, 2015 16:09
Generating waveform & spectrum plots with NumPy & matplotlib
#!/usr/bin/env python3
"""sound_plots.py: Simple example using NumPy & matplotlib to generate some
sound waveforms, plot them with their frequency spectra, and write out WAV
files of them."""
import numpy
import matplotlib.pyplot as plt
import wave
import struct
@Hodapp87
Hodapp87 / ivory.patch
Last active August 29, 2015 14:19
Patch for Ivory (GHC 7.10)
diff --git a/Makefile b/Makefile
index db883e9..2d0807d 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,6 @@ PACKAGE= \
ivory-backend-acl2 \
ivory-backend-c \
ivory-eval \
- ivory-examples \
ivory-hw \
@Hodapp87
Hodapp87 / shell.nix
Created April 21, 2017 17:24
darktable shell.nix draft
{ pkgs ? import <nixpkgs> {} }:
# Based on nixpkgs/pkgs/applications/graphics/darktable/default.nix
let stdenv = pkgs.stdenv;
#assert stdenv ? glibc;
in stdenv.mkDerivation rec {
name = "darktable-git";
src = pkgs.lib.cleanSource ./.;

CGAL dabbling

@Hodapp87
Hodapp87 / Dockerfile
Created May 18, 2020 13:24
ox-hugo test
FROM ubuntu:18.04
RUN apt-get update -y \
&& apt-get install -y emacs-nox ca-certificates wget unzip \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /root/.emacs.d
COPY init.el /root/.emacs.d/
COPY test.org /root