Skip to content

Instantly share code, notes, and snippets.

View dbechrd's full-sized avatar

Dan Bechard dbechrd

View GitHub Profile
@dbechrd
dbechrd / timer.c
Created February 21, 2020 07:55
Cross-platform, drop-in, high resolution timer for C/C++ projects.
/* ----------------------------------------------------------------------- */
/*
Easy embeddable cross-platform high resolution timer function. For each
platform we select the high resolution timer. You can call the 'ns()'
function in your file after embedding this.
*/
#include <stdint.h>
#if defined(__linux)
# define HAVE_POSIX_TIMER
# include <time.h>
@dbechrd
dbechrd / hb_stb_truetype.c
Created March 12, 2020 22:18 — forked from rygorous/hb_stb_truetype.c
HarfBuzz->stb_truetype
// ---- loading a font
static void load_font(void)
{
hb_blob_t *blob;
hb_face_t *face;
size_t filelen = 0;
void *filedata = stb_file("c:/windows/fonts/arial.ttf", &filelen);
if (filedata == 0) stbpg_fatal("Couldn't load font");
@dbechrd
dbechrd / Antiscan
Created December 3, 2019 13:32 — forked from dkrutsko/Antiscan
Detects whether the memory of your process has been scanned
// Link with psapi.lib
#define NOMINMAX
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Psapi.h>
int main (void)
{
@dbechrd
dbechrd / .screenrc-main-example
Last active September 20, 2017 02:54 — forked from ChrisWills/.screenrc-main-example
A nice default screenrc
# GNU Screen - main configuration file
# All other .screenrc files will source this file to inherit settings.
# Author: Christian Wills - cwills.sys@gmail.com
# Modified by: Dan Bechard dbechrd@gmail.com
# Allow bold colors - necessary for some reason
attrcolor b ".I"
# Tell screen how to set colors. AB = background, AF=foreground
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'