This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
help() { | |
echo "Recursively convert resource files into embeddable C headers" | |
echo "" | |
echo "USAGE" | |
echo " $ cres <src> <dest>" | |
} | |
if [ -z "$1" ] || [ -z "$2" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// macOS | |
// CFLAGS += -ObjC | |
// LDFLAGS += -framework Cocoa | |
#import <Cocoa/Cocoa.h> | |
int main() { | |
[NSApplication sharedApplication]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// macOS | |
// CFLAGS += -ObjC | |
// LDFLAGS += -framework Cocoa -framework OpenGL | |
#define GL_SILENCE_DEPRECATION 1 | |
#import <Cocoa/Cocoa.h> | |
#include <OpenGL/gl.h> | |
int main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// macOS | |
// CFLAGS += -ObjC | |
// LDFLAGS += -framework Cocoa -framework OpenGL -framework AudioToolbox | |
#define GL_SILENCE_DEPRECATION 1 | |
#import <Cocoa/Cocoa.h> | |
#include <OpenGL/gl.h> | |
#include <AudioToolbox/AudioToolbox.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" useful if you want to use alt + * key combs and your terminal sends out esc for alt keys | |
for k in split("qwertyuiopasdfghjklzxcvbnm1234567890`-=\\;',./", '\zs') | |
exec 'map <esc>' . k . ' <m-' . k . '>' | |
exec 'map! <esc>' . k . ' <m-' . k . '>' | |
endfor | |
for k in split('cr bs tab left right up down') | |
exec 'map <esc><' . k . '> <m-' . k . '>' | |
exec 'map! <esc><' . k . '> <m-' . k . '>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $ cc fserv.c -o fserv | |
// | |
// start a static file server at current directory | |
// $ ./fserv | |
// | |
// specify a port | |
// $ ./fserv -p 1234 | |
#include <stdio.h> | |
#include <stdlib.h> |