Skip to content

Instantly share code, notes, and snippets.

Johannes Pfau jpf91

Block or report user

Report or block jpf91

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jpf91
jpf91 / formatter.d
Created Mar 14, 2011
jpf.http.formatter
View formatter.d
/**
* Contains functions to format the jpf.http.types types
* into the HTTP format (formatValue, formatHeader).
*
* TODO:
* Remove trailing zeros with floating point numbers
* Spec allows this, but it wastes bandwidth
*
* Not implemented headers:
* Authorization
View http.d
final class HeaderCollection
{
private:
struct Entry
{
//Case preserved
string Key;
string Value;
}
Entry[string] storage;
@jpf91
jpf91 / gist:937492
Created Apr 22, 2011
Swig4D class cast proposal
View gist:937492
/*
* C++ Class structure:
*
* Shape
* |- Circle
* |- Rectangle
* |-Square
*
*/
View gist:938408
%module bug;
//Use swig2.0 -Wall -d -d2 -c++ bug.i
//Then in the generated files:
//in Test/Test.d:
//"class Tag : ..strList {"
template <class T> class List
{
public:
View gist:938547
%module bug;
//Use swig2.0 -Wall -d -d2 -c++ bug.i
//Then in the generated files:
//in Test/Test.d:
//"class AttachedPictureFrame : Test.Frame {"
//should be
//"class AttachedPictureFrame : Test.Test.Frame {"
namespace Test {
View gist:1035294
import std.datetime;
import std.array;
import std.conv;
import std.string;
import std.algorithm;
struct PackageVersion
{
enum VersionType
{
View gist:1064625
/**
* Original libev documentation:
* $(LINK2 http://pod.tst.eu/http://cvs.schmorp.de/_libev/ev.pod?pathrev=rel-3__9, version 3.9)
* $(LINK2 http://pod.tst.eu/http://cvs.schmorp.de/_libev/ev.pod?pathrev=rel-4__04, version 4.04)
* $(LINK2 http://pod.tst.eu/http://cvs.schmorp.de/_libev/ev.pod, most recent version)
*/
module jpf.c.libev;
/*
* libev native API header
View gist:1099229
struct File
{
private struct Impl
{
uint refs = uint.max / 2;
//Other 'by-reference' members ...
this(uint r)
{
refs = r;
}
View gist:1099360
struct File
{
private struct Impl
{
uint refs = uint.max / 2;
//Other 'by-reference' members ...
this(uint r)
{
refs = r;
}
View gist:1103852
import std.stdio;
import std.typecons;
void main()
{
auto wrap1 = Wrapper(1);
}
void free(ref int _payload)
{
You can’t perform that action at this time.