Skip to content

Instantly share code, notes, and snippets.

@buserror
buserror / gist:3052259
Created July 5, 2012 08:26
devil fails to build on mountain lion
Follows "brew doctor" reported mismatch is because I have the mountain lion toolchain
installed (command line tools), but not the preliminary buggy xcode
---------------------------------------- brew doctor
Error: Your compilers are different from the standard versions for your Xcode.
If you have Xcode 4.3 or newer, you should install the Command Line Tools for
Xcode from within Xcode's Download preferences.
Otherwise, you should reinstall Xcode.
@buserror
buserror / gist:3129219
Created July 17, 2012 12:47
cortex-m4/stm32f4 longjmp/setjmp implementation with FPU store/restore
/*
* tested with gcc on an stm32f4
* Michel Pollet <buserror@gmail.com>
*/
#if defined(__VFP_FP__)
typedef long __jmp_buf[10 + 8 + 1]; // d8-d15 fpu + fpscr
#else
typedef long __jmp_buf[10];
#endif
@buserror
buserror / boxmaker.js
Created November 11, 2015 06:28
millcrum.com small test to generate boxes
// examples/all_objects.millcrum - sample showing every basic object and operation
// create the tool options
// units: mm or inch
// diameter: tool diameter in mm or inch
// passDepth: depth to cut per pass in mm or inch, if a cut operation has a deeper depth then multiple passes will occur
// step: how far the bit should step for pocket operations, between 0 and 1 (full step)
// rapid: how fast the tool should move when it is not cutting
// plunge: how fast the tool should move down on the Z axis when cutting
// cut: how fast the tool should move on the X and Y axes when cutting
// zClearance: how high above the surface the tool should be when not cutting
@buserror
buserror / gist:7336713
Created November 6, 2013 14:16
quick compilation patch
From 3e76304ff29e91507aa275dfcdff77cab7109ae3 Mon Sep 17 00:00:00 2001
From: michel <michel@midesk.bsiuk.com>
Date: Wed, 6 Nov 2013 14:21:03 +0000
Subject: [PATCH] freetype-gl: fix on modern mesa
GL_TYPE is already taken, apparently
---
shared/libfreetype-gl/vertex-attribute.c | 20 ++++++++++----------
shared/libfreetype-gl/vertex-attribute.h | 26 +++++++++++++-------------
2 files changed, 23 insertions(+), 23 deletions(-)
@buserror
buserror / jit_code.c
Created March 1, 2017 08:11
For Sprity
static const void * jt[342] = {
[0x0000]= &&f0000,
[0x0001]= &&f0002,
[0x0002]= &&f0004,
[0x0003]= &&f0006,
[0x0004]= &&f0008,
[0x0005]= &&f000a,
[0x0006]= &&f000c,
[0x0007]= &&f000e,
[0x0008]= &&f0010,
/*
* make tea CFLAGS="-std=gnu99"
*
* ./tea "hello there how r You" -d "FOF5;?9#LDQ2'MAI\LT286+]\$63@Q;JG"
*
* XXTEA Encoder/decoder test program
* (C) Michel Pollet <buserror@gmail.com>
*/
#include <stdint.h>
#include <stdio.h>
@buserror
buserror / clocks.c
Last active May 17, 2018 11:28
proposal for the clock table
struct rzn1_bitsel {
uint16_t sel;
uint16_t gate[2][5];
};
struct rzn1_gate {
uint16_t gate, reset, ready, midle,
scon, mirack, mistat;
};
@buserror
buserror / Compiler Abuse
Created December 31, 2019 23:44
On a G4, the pipelining was crucial. And on a 8 channel 24 bits (well 32) audio path, it was even more so.
/*
* Clip_48_8.cpp
* EZ8AudioDriver
*
* Created by Michel on Sun Oct 06 2002.
* Copyright (c) 2002 __MyCompanyName__. All rights reserved.
*
*/
#include <libkern/OSTypes.h>
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
*/
/* #undef CRAY_STACKSEG_END */
#!/usr/bin/tcc -run
/*
* ^^ If you don't know tcc, you should.
*
* This program is a wrapper around make(1), it parses recursive make
* output and try to generate valid pathnames for errors generated by
* the compiler for relative pathnames.
* It keep tracks (well it tries to) of parallel make jobs and try to
* look in the directory for all the running jobs for a matching
* pathnames, then doctor the error message with the 'real' pathname.