Skip to content

Instantly share code, notes, and snippets.

View justinbowes's full-sized avatar
💭
I may be slow to respond.

Justin Bowes justinbowes

💭
I may be slow to respond.
View GitHub Profile
@cenit
cenit / vcpkg_with_VS_projects.md
Created November 11, 2017 11:13
small tutorial on how to add proper tags to vcxproj files to enable vcpkg

While vcpkg works without any problem and any modification for the default triplet (x86-windows), if you need to use vcpkg libraries in your project targeting different triplets a small manual tag addition is required.

Open the project' .vcxproj file and find this section:

  <PropertyGroup Label="Globals">
        ....
  </PropertyGroup>
@Flix01
Flix01 / edtaa3func.h
Last active May 26, 2024 19:21
A Signed Distance Font Builder for Dear ImGui
/*
* edtaa3()
*
* Sweep-and-update Euclidean distance transform of an
* image. Positive pixels are treated as object pixels,
* zero or negative pixels are treated as background.
* An attempt is made to treat antialiased edges correctly.
* The input image must have pixels in the range [0,1],
* and the antialiased image should be a box-filter
* sampling of the ideal, crisp edge.
@madgarden
madgarden / williams_robotron_synth.c
Last active February 16, 2022 15:12
Williams Robotron sound synth, adapted to C from https://www.lomont.org/software/misc/robotron/
// Williams Robotron sound synth, adapted to C from https://www.lomont.org/software/misc/robotron/
// LICENSE
//
// This software is dual-licensed to the public domain and under the following
// license: you are granted a perpetual, irrevocable license to copy, modify,
// publish, and distribute this file as you see fit.
#define CR_START(n) { int *crptr = (n); switch(*crptr) { case 0:
#define CR_YIELD_VOID do { *crptr =__LINE__; return; case __LINE__:;}while(0);
#define CR_YIELD(x) do { *state =__LINE__; return x; case __LINE__:; }while(0);
@madgarden
madgarden / wav-play.c
Last active May 27, 2016 17:59
wav-play: A WAV loader/player I use for all of my projects, created initially for Saucelifter. Just needs a (sound) buffer for output. Only implemented what I currently need for my games, and for that it works just fine. You can find the unfinished stubs in the code.
// The Madgarden games WAV player
// LICENSE
//
// This software is dual-licensed to the public domain and under the following
// license: you are granted a perpetual, irrevocable license to copy, modify,
// publish, and distribute this file as you see fit.
/*
TODO: Post-process clipping (need 32-bit mix buffer)
anonymous
anonymous / udpnet.c
Created April 5, 2013 22:47
Simple UDP wrapper
#include "udpnet.h"
#if defined WIN32
typedef int socklen_t;
#else
#define closesocket(s) close(s)
#endif
static int udp_err_ = 0;
@jorgenpt
jorgenpt / stream.sh
Created April 21, 2012 06:59
Commands to stream desktop to justin.tv on OS X
#!/bin/sh -xe
API_KEY="YOUR_API_KEY_GOES_HERE"
FPS="10"
VLC_PATH="/Applications/VLC.app/Contents/MacOS/VLC"
# I don't know how this'll behave on multimon, so you might want to hard-code.
# INRES='1440x900'
INRES=$(osascript -e 'tell application "Finder" to get bounds of window of desktop'|sed 's/, /x/g'|cut -f3- -dx)
OUTRES='1280x800'
# You can change this to record microphone or something else, from man soxformat (under coreaudio):
@bzerangue
bzerangue / php.ini
Created February 17, 2012 19:00
PHP.ini for Mac OS X Lion (running Litespeed)
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order: