Skip to content

Instantly share code, notes, and snippets.

View apfohl's full-sized avatar

Andreas Pfohl apfohl

View GitHub Profile
@apfohl
apfohl / getline.c
Created June 14, 2015 18:41
getline example
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
FILE *fp = fopen("file.c", "r");
char *line = NULL;
size_t linelen = 0;
ssize_t len;
@apfohl
apfohl / astyle.c
Created March 6, 2015 12:28
astyle example
/* astyle --style=kr --indent=spaces=4 --indent-switches --pad-oper --pad-header --align-pointer=name --add-brackets -n main.c
* astyle -A3s4SpHk3jn main.c
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
enum state {
NONE = 1,
@apfohl
apfohl / va_arg.c
Created November 13, 2014 17:05
va_arg c example
#include <stdio.h>
#include <stdarg.h>
int sum(int argc, ...)
{
int res = 0;
va_list ap;
va_start(ap, argc);
@apfohl
apfohl / install.md
Last active August 29, 2015 14:05
Installing GitLabHQ with FreeBSD 10

/etc/make.conf

WITH_PKGNG=       yes
WITH_PGSQL_VER=   93
DEFAULT_VERSIONS= ruby=2.1 python=2.7

commands

% cd /usr/ports/ports-mgmt/pkg

% make install clean

@apfohl
apfohl / makeindex-fix.patch
Created October 17, 2013 17:55
This patch fixes the makeindex path problem with Rubber.
diff --git a/src/latex_modules/index.py b/src/latex_modules/index.py
index eb59023..a682788 100644
--- a/src/latex_modules/index.py
+++ b/src/latex_modules/index.py
@@ -38,7 +38,7 @@ this argument, they apply to all indices declared at the point where they
occur.
"""
-import os, os.path, re
+import os, os.path, re, string