Skip to content

Instantly share code, notes, and snippets.

View samueltardieu's full-sized avatar

Samuel Tardieu samueltardieu

View GitHub Profile
@samueltardieu
samueltardieu / ips.c
Created July 26, 2011 09:54 — forked from bortzmeyer/gist:1086392
Resolve names, using the standard library (so, going through NSS and things like that, unlike dig)
// Compile with -std=gnu99 to get the proper definitions of struct addrinfo
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <errno.h>
#include <netinet/in.h>
// Use with a default value as in:
// runningScalaVersion getOrElse "2.8.0"
lazy val runningScalaVersion = {
val matcher = """version (\d+\.\d+\.\d+).*""".r
util.Properties.versionString match {
case matcher(vsn) => Some(vsn)
case _ => None
}
}