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);
@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);
View ui.coffee
###
UI Element classes
Written by Eddie Ringle
###
class Button extends HTMLButtonElement
constructor: (@className, value) ->
@innerHTML = value
setValue: (value) ->
@EddieRingle
EddieRingle / hashtable.c
Created Oct 28, 2011
A Neat HashTable Implementation
View hashtable.c
/*
* 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 Oct 23, 2011
A Neat DArray Implementation
View darray.c
/*
* 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 Oct 23, 2011
A Neat LList Implementation
View llist.c
/*
* 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 Aug 18, 2011
All-in-one script for system maintenance via APT
View update
#!/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 Jul 18, 2011
Cerberus Entity class header
View entity.h
/*
* 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.
View gist_test
Test 1
Modifying this gist.