Skip to content

Instantly share code, notes, and snippets.

View odeke-em's full-sized avatar

Emmanuel T Odeke odeke-em

View GitHub Profile
@odeke-em
odeke-em / commonPrefix.go
Last active August 29, 2015 14:15
commonPrefix.go
package main
import "fmt"
func commonPrefix(values ...string) string {
vLen := len(values)
if vLen < 1 {
return ""
}
minIndex := 0
@odeke-em
odeke-em / lib_loader.c
Created February 11, 2015 20:31
lib loader
// Author: Emmanuel Odeke <[email protected]>
// Module to handle platform agnostic loading of dynamic libraries
#include <stdio.h>
#include <stdlib.h> // For exit(...)
#include <stdarg.h>
#include "lib_loader.h"
static errorReporter errReporter = NULL;
@odeke-em
odeke-em / urlWalker.js
Last active August 29, 2015 14:14
URL Walker.
var _un = require('underscore');
var url = require('url');
var util = require('util');
var request = require('request');
function walkUrl(targetUrl, callback) {
var probes = {};
var errBucketIndex = 5;
// status codes are in the range 100 - 999
@odeke-em
odeke-em / gist:57350d2c525416d1a8f8
Created December 29, 2014 21:30
Bud erraneous index
diff --git a/src/master.c b/src/master.c
index cd846e1..0733d3b 100644
--- a/src/master.c
+++ b/src/master.c
@@ -354,7 +354,7 @@ bud_error_t bud_master_get_spawn_args(bud_config_t* config, char*** out) {
} else {
/* Goal is to skip piped_index, thus excluding --piped-config argument: */
for (i = 0, j = 0; i < config->piped_index; i++, j++)
- args[j++] = config->argv[i];
+ args[j] = config->argv[i];
@odeke-em
odeke-em / Makefile
Last active August 29, 2015 14:02
Dictionary implementation using a Trie.
CC := gcc
radTest: radLoadWords.c radTrie.o element.o wordTransition.o
$(CC) -DTEST_LOAD_WORDS radTrie.o element.o wordTransition.o radLoadWords.c -o $@
%.o: %.c
$(CC) -c $< -o $@
clean:
rm -f *.o radTest