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);
@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);
###
UI Element classes
Written by Eddie Ringle
###
class Button extends HTMLButtonElement
constructor: (@className, value) ->
@innerHTML = value
setValue: (value) ->
@EddieRingle
EddieRingle / hashtable.c
Created October 28, 2011 02:18
A Neat HashTable Implementation
/*
* Copyright (c) 2011 Eddie Ringle <eddie@eringle.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@EddieRingle
EddieRingle / darray.c
Created October 23, 2011 21:46
A Neat DArray Implementation
/*
* Copyright (c) 2011 Eddie Ringle <eddie@eringle.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@EddieRingle
EddieRingle / llist.c
Created October 23, 2011 15:50
A Neat LList Implementation
/*
* Copyright (c) 2011 Eddie Ringle <eddie@eringle.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
@EddieRingle
EddieRingle / update
Created August 18, 2011 21:37
All-in-one script for system maintenance via APT
#!/bin/sh
#
# All-in-one script for system maintenence via APT
#
# sudo wget http://files.idlesoft.net/pub/update -O /usr/local/sbin/update
# sudo chmod a+x /usr/local/sbin/update
#
echo ".::Updating sources::."
apt-get update
@EddieRingle
EddieRingle / entity.h
Created July 18, 2011 21:47
Cerberus Entity class header
/*
* Copyright (c) 2011 Eddie Ringle <eddie@eringle.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
Test 1
Modifying this gist.