Skip to content

Instantly share code, notes, and snippets.

@rikkimax
rikkimax / gist:6559396
Created September 14, 2013 06:41
Binding generator MingX x64 WinAPI headers to D.
gcc test.c -E -P > $1
echo $1 > temp
sed -i 's/.[a-zA-Z]$//g' temp
sed -i 's/\//./g' temp
module=`cat temp`
echo $1 > temp
sed -i 's/\//\\\//g' temp
fileDash=`cat temp`
#version 330
uniform int win_Height;
uniform int win_Width;
uniform int com_Height;
uniform int com_Width;
uniform int com_X;
uniform int com_Y;
uniform int com_Count;
module common.session.mongo;
import vibe.http.session;
import vibe.db.mongo.mongo;
class MongoSessionStore : SessionStore {
protected {
MongoClient client;
MongoCollection collection;
}
module common.routing;
public import vibe.http.router;
import std.file : append, write;
__gshared URLRouter urlRouter = new URLRouter();
private string logFile = null;
void setRoutingLogFile(string file) {
logFile = file;
}
module main;
import orm;
@tableName("Books")
class Book {
@id
@name("id")
string isbn;
@defaultValue("0")
@rikkimax
rikkimax / routing.d
Created January 2, 2014 09:20
My little router. Written in D utilising Vibe.
module rh.common.routing;
public import vibe.http.router;
import std.file : append, write;
import std.traits : moduleName;
__gshared URLRouter urlRouter = new URLRouter();
private string logFile = null;
void setRoutingLogFile(string file) {
logFile = file;
@rikkimax
rikkimax / session.d
Created January 2, 2014 09:44
Session storage utilising Dvorm and Vibe.
module common.session;
import dvorm;
@dbname("Session")
class SessionModel {
@id {
string key;
string name;
}
@rikkimax
rikkimax / zpm
Created January 24, 2014 11:43
A zpm model generator for blender 2.6, No material generation present.
import bpy
import random
from math import sin, cos
cubeobject = bpy.ops.mesh.primitive_cube_add
torusobject = bpy.ops.mesh.primitive_torus_add
coneobject = bpy.ops.mesh.primitive_cone_add
planeobject = bpy.ops.mesh.primitive_plane_add
resizeObject = bpy.ops.transform.resize
@rikkimax
rikkimax / book.d
Created January 25, 2014 09:41
Book data model as an example
module cmsed.test.models.book;
import cmsed.base.routing;
import dvorm;
@dbName("Books3")
class Book3 {
@dbId
@dbName("")
Book3Id key = new Book3Id;
module cmsed.test.models;
import cmsed.base.registration.model;
public import cmsed.test.models.book;
shared static this() {
registerModel!Book3;
registerModel!Page3;
}