Skip to content

Instantly share code, notes, and snippets.

View EddieRingle's full-sized avatar

Eddie Ringle EddieRingle

View GitHub Profile
@EddieRingle
EddieRingle / barr.c
Created January 10, 2014 05:25
A dynamic bit array, I guess.
#include <stdlib.h>
#include <string.h>
#ifndef barr_malloc
# define barr_malloc(sz) malloc(sz)
#endif
#ifndef barr_realloc
# define barr_realloc(ptr, sz) realloc(ptr, sz)
#endif

Keybase proof

I hereby claim:

  • I am eddieringle on github.
  • I am eddieringle (https://keybase.io/eddieringle) on keybase.
  • I have a public key ASBXWoQrKrN87i6ilKnDBWvgWuQO6YMd3gZy2rQJZ81Qzwo

To claim this, I am signing this object:

@EddieRingle
EddieRingle / dblcheck.php
Created April 22, 2012 18:12
Spamhaus DBL example
<?php
/* Let's say the variable $input contains a user-submitted link */
$parsed_url = parse_url($input);
if ($parsed_url != false) {
/* The domain should be found using the 'host' key */
$domain = $parsed_url['host'];
/* Now check that domain against the DBL */
$dbl_record = dns_get_record($domain);