Skip to content

Instantly share code, notes, and snippets.

View mlabbe's full-sized avatar

Michael Labbe mlabbe

View GitHub Profile
@mlabbe
mlabbe / quarantine_node.sh
Created September 15, 2018 15:22
Install Quarantined NodeJS to avoid systemwide pollution
export INSTALLDIR=$HOME/dev/node/local # or wherever
mkdir -p $INSTALLDIR
# Put these lines in your .bashrc
export PATH=$INSTALLDIR/bin:$PATH
export MANPATH=$INSTALLDIR/share/man
git clone https://github.com/nodejs/node
cd node
@mlabbe
mlabbe / calc.c
Last active April 30, 2025 20:32
A simple calculator written as an ll1 recursive descent parser
/*
simple calculator implemented via recursive descent
add_op := + | -
mul_op := * | /
digits := {+|-} [0..9] {[0..9]}
expr := term {add_op term}
term := factor {mul_op factor}
@mlabbe
mlabbe / ftg_core.h
Last active December 4, 2021 00:26
/* clang-format off */
/* ftg_core.h - v0.6 - Frogtoss Toolbox. Public domain-like license below.
ftg libraries are copyright (C) 2015-2021 Frogtoss Games, Inc.
http://github.com/mlabbe/ftg_toolbox
ftg header files are single file header files intended to be useful
in C/C++. ftg_core contains generally useful functions
Special thanks to STB for the inspiration.
@mlabbe
mlabbe / gist:5a302600f025ff95fc6e7c04c0def7a3
Created March 11, 2018 21:01
emacsclient icon for Linux Mint Mate Desktop
[Desktop Entry]
encoding=utf-8
Exec=/usr/local/bin/emacsclient -c
Icon=/usr/share/app-install/icons/_usr_share_emacs_21.4_etc_gnu-32x32.xpm
Type=Application
Terminal=false
Comment=Emacs Client
Name=Emacs Client
GenericName=emacsclient
StartupNotify=false

Keybase proof

I hereby claim:

  • I am mlabbe on github.
  • I am mlabbe (https://keybase.io/mlabbe) on keybase.
  • I have a public key ASAmuKRhgWieXfXRIeSxLec5dDSoW48Mi69lVtOp7Qweewo

To claim this, I am signing this object:

@mlabbe
mlabbe / feast.md
Last active August 25, 2017 19:50
Build system thoughts

Feast

Existing makefile-like build systems conflate what we are building with how we are building it. Every project has its own Makefile, autoconf, vsproj, etc., which explain how to build it, and where the files are.

In reality, many simple projects build exactly the same way. That way may involve complex steps, but rarely do they differ meaningfully. It does not make sense to write out a different recipe every time you buy groceries, so why should you re-describe how a project builds every time you begin a new, similar project?

Components of Feast Defined

  • Feast: A completed set of build products.
  • Kitchen: A tool environment (ex: vs2015 64-bit on Windows 10).
  • Dish: A single completed build product.
@mlabbe
mlabbe / sms.c
Last active June 22, 2017 00:13
struct string
#include <stdio.h>
typedef struct {
char s[6];
int len;
}str_t;
int main(void)
{
str_t str = {"hello", 6};
@mlabbe
mlabbe / nativeprojectstandards.md
Last active August 18, 2016 20:04
Native Project Standards
@mlabbe
mlabbe / sbs.pde
Last active July 7, 2016 01:40
Side by Side Processing Demonstration
////
//
// This single-file no-dependency Processing 3 sketch demonstrates
// how you can livecode side-by-side VR content in Processing and
// render it in realtime!
//
// All comments exist to help the reader understand the approach.
//
// Youtube render of this sketch:
// https://www.youtube.com/watch?v=E3d7d8XR4Y0&feature=youtu.be
@mlabbe
mlabbe / ftg_core.h
Last active October 5, 2016 23:40
ftg_core.h
/* ftg_core.h - v0.5 - Frogtoss Toolbox. Public domain-like license below.
ftg libraries are copyright (C) 2015 Frogtoss Games, Inc.
http://github.com/mlabbe/ftg_toolbox
ftg header files are single file header files intended to be useful
in C/C++. ftg_core contains generally useful functions
Special thanks to STB for the inspiration.