Skip to content

Instantly share code, notes, and snippets.

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct token_t
{
char token;
int count;
}
@abstractOwl
abstractOwl / logc.c
Last active August 29, 2015 14:01
Simple C Logging Library
#include <stdio.h>
#define LOG_NONE (0)
#define LOG_WARN (1)
#define LOG_INFO (2)
#define WARN(...)
#define INFO(...)
#define LOG_LEVEL LOG_INFO // Set log level here
@abstractOwl
abstractOwl / pdfgrep.sh
Created May 18, 2014 23:36
grep a directory of pdfs
#!/bin/sh
for f in ${2}/.pdf; do
out=$(pdftotext $f - | grep -n $1)
if [ $? -eq 0 ]; then
echo -e "${f}:\n${out}\n"
fi
done
@abstractOwl
abstractOwl / index.html
Created July 11, 2014 06:54
Aspect-Oriented Programming Example. Live: http://jsfiddle.net/z8GXU/
<!DOCTYPE html>
<html lang="en">
<head>
<title>AOP Example</title>
<style type="text/css">
#log {
background: #EEE;
height: 300px;
overflow: auto;
}