Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
addline()
{
NEXT="$(printf "%s% $((50-${#LASTNAME}))d% 10d %10d" "$LASTNAME" "$OLD" "$NEW" "$DELTA")"
[ -z "$STUFF" ] &&
STUFF="$NEXT" ||
STUFF="$(printf "%s\n%s" "$STUFF" "$NEXT")"
}
bloatcheck()
@technosaurus
technosaurus / svg_generator.c
Created May 6, 2017 01:10
SVG image generator for nanosvg compatible text using paths
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *stpcpy(char *dest, const char *src);
#define FONT_HEIGHT 16
#define FONT_WIDTH 8
#define TAB_WIDTH 32
#define TAB_PATH(x) "m" #x " 0"
#define ICON_HEIGHT 96
#define ICON_WIDTH 96
@technosaurus
technosaurus / xcbiv.c
Created November 7, 2015 04:19
simple xcb image viewer using nanosvg and stb-image
#include <xcb/xcb.h>
#include <xcb/xcb_image.h>
#define STBI_NO_HDR
#define STBI_NO_LINEAR
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
#define NANOSVG_IMPLEMENTATION
#include "nanosvg.h"
#define NANOSVGRAST_IMPLEMENTATION
#include "nanosvgrast.h"
@technosaurus
technosaurus / jwm-image-lite.c
Created November 7, 2015 01:16
use lighter image loaders for jpg,png and svg + support gif,bmp,tga and others
/**
* @file image.c
* @author Joe Wingbermuehle
* @date 2005-2007
*
* @brief Functions to load images.
*
*/
#include "jwm.h"
@technosaurus
technosaurus / jwm-stb.patch
Last active November 4, 2015 02:00
2 patches to add stb-image support to jwm
--- jwm-master/src/image.c 2015-11-02 20:53:46.000000000 +0800
+++ jwm-stb/src/image.c 2015-11-04 00:14:58.910120109 +0800
@@ -12,11 +12,15 @@
#ifndef MAKE_DEPEND
/* We should include png.h here. See jwm.h for an explanation. */
-
+#ifdef USE_STB_IMAGE
+#define STBI_ASSERT(x)
+#define STB_IMAGE_IMPLEMENTATION