Skip to content

Instantly share code, notes, and snippets.

View benwills's full-sized avatar

Ben Wills benwills

View GitHub Profile
const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.124 2013/03/20 11:30:05 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $
*
* Purpose : Contains wrappers for system-specific sockets code,
* so that the rest of Junkbuster can be more
* OS-independent. Contains #ifdefs to make this work
* on many platforms.
*
@benwills
benwills / uz.c
Last active August 29, 2015 14:12 — forked from supr/uz.c
#include <sys/mman.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#define INDEX(B, P) ((P) - (B))
#include <sys/mman.h>
#include <stdlib.h>
#include <unistd.h>
#define report_exceptional_condition() abort ()
struct ring_buffer
{
@benwills
benwills / threads.tmpl.pl
Last active August 29, 2015 14:10
Template: Perl Thread Queue
#! perl -slw
use threads stack_size => 8*4096;
use Thread::Queue;
############################################################
#
# There are pipe errors that happen. I came across only
# one, but it breaks the code entirely.
#
@benwills
benwills / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console