Skip to content

Instantly share code, notes, and snippets.

Avatar

Eddie Ringle EddieRingle

View GitHub Profile
@EddieRingle
EddieRingle / dblcheck.php
Created Apr 22, 2012
Spamhaus DBL example
View dblcheck.php
<?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);
View keybase.md

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 Jan 10, 2014
A dynamic bit array, I guess.
View barr.c
#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
View hash_fun.patch
--- 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 Jul 25, 2012
A Slide-out Navigation Implementation for Android
View gist:3179361

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

@EddieRingle
EddieRingle / gist:3086528
Created Jul 10, 2012
List of things pooshed to the AOSP 4.1.1 build from the I/O JB image for toro
View gist:3086528
/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
View preferences.c
#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) {
View gameLoop.coffee
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 Mar 24, 2012
Simple JSON to HTML thingy
View gist:2189280
shapeOptions = [
{
node: "select"
children: [
{
node: "option"
attrs: {
value: "rectangle"
}
content: "Rectangle"
@EddieRingle
EddieRingle / example.c
Created Mar 10, 2012
I don't even know
View example.c
struct crb_game {
int state;
char *name;
crb_gfx *gfx;
crb_snd *snd;
crb_lua *lua;
int (*on_start)(void);
int (*on_stop)(void);