Skip to content

Instantly share code, notes, and snippets.

View EddieRingle's full-sized avatar

Eddie Ringle EddieRingle

View GitHub Profile
@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);

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 / 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
--- util/google/sparsehash/sparseconfig.h
+++ util/google/sparsehash/sparseconfig.h
@@ -5,7 +5,7 @@
#define GOOGLE_NAMESPACE ::google
/* the location of <hash_fun.h>/<stl_hash_fun.h> */
-#define HASH_FUN_H "hash_fun.h"
+#define HASH_FUN_H </usr/include/c++/4.2.1/ext/hash_fun.h>
/* the location of <hash_map> */
@EddieRingle
EddieRingle / gist:3179361
Created July 25, 2012 23:34
A Slide-out Navigation Implementation for Android

This Gist is now embodied in the form of Undergarment. That is all.

@EddieRingle
EddieRingle / gist:3086528
Created July 10, 2012 22:08
List of things pooshed to the AOSP 4.1.1 build from the I/O JB image for toro
/vendor/firmware/ducati-m3.bin
/vendor/firmware/libpn544_fw.so
/vendor/firmware/smc_pa_wvdrm.ift
/vendor/lib/libsec-ril.so
/vendor/lib/libwvdrm_L1.so
/vendor/lib/libwvm.so
/vendor/lib/libWVStreamControlAPI_L1.so
/vendor/lib/drm/libdrmwvmplugin.so
/vendor/lib/hw/gps.omap4.so
/etc/permissions/com.vzw.hardware.ehrpd.xml
#include "crb/preferences.h"
static struct crb_preferences *prefs;
int crb_preferences_initialize(char *prefs_file)
{
if (prefs != NULL)
crb_preferences_cleanup();
if (prefs_file == NULL) {
gameLoop: ->
@running = true
@lastTickCount = 0
@totalTickCount = 0
lastTick = lastFrame = psTicks = 0
ticksSince = 0
frames = ticks = 0
doTick = doFrame = no
updateLoop = (currentTicks) =>
doTick = (currentTicks - lastTick) > (1000 / @targetTickrate)
@EddieRingle
EddieRingle / gist:2189280
Created March 24, 2012 23:49
Simple JSON to HTML thingy
shapeOptions = [
{
node: "select"
children: [
{
node: "option"
attrs: {
value: "rectangle"
}
content: "Rectangle"
@EddieRingle
EddieRingle / example.c
Created March 10, 2012 02:15
I don't even know
struct crb_game {
int state;
char *name;
crb_gfx *gfx;
crb_snd *snd;
crb_lua *lua;
int (*on_start)(void);
int (*on_stop)(void);