Skip to content

Instantly share code, notes, and snippets.

View MartinNowak's full-sized avatar
🎯
Focusing

dawg MartinNowak

🎯
Focusing
View GitHub Profile
import std.conv;
struct CppMangler
{
CppMangler namespace(string name)
{
return nested(name);
}
CppMangler klass(string name)
/**
*
*/
extern (C) void rt_finalize(void* p, bool det = true)
{
debug(PRINTF) printf("rt_finalize(p = %p)\n", p);
static void zeromem(void *dst, size_t size)
{
immutable n = size / size_t.sizeof;
import core.atomic;
import core.thread;
// debug = VERBOSE;
debug = PRINTF;
debug (VERBOSE) debug = PRINTF;
debug(PRINTF) extern(C) int printf(const char*, ...);
@property shared(SyncClass) sync()
{
;;; d-mode.el --- D Programming Language mode for (X)Emacs
;;; Requires a cc-mode of version 5.30 or greater
;; Author: 2007 William Baxter
;; Contributors: Andrei Alexandrescu
;; Maintainer: William Baxter
;; Created: March 2007
;; Version: 2.0.4 (February 2008)
;; Keywords: D programming language emacs cc-mode
import std.traits;
import core.memory;
struct Ptr(T)
{
static if (is(T == class))
alias T RefT;
else
alias T* RefT;
import core.bitop, core.stdc.stdlib;
import std.algorithm, std.array, std.conv, std.traits;
import std.stdio;
struct TrieMap(Key, Value) if(isUnsigned!Key)
{
@disable this(this);
~this()
{
module lexer;
import std.algorithm, std.conv, std.exception, std.functional, std.range, std.string, std.traits, std.typetuple;
/*
* TokenDeclaration
* name - used to define enum member
* pattern - used as lexer pattern
* action - expression to evaluate when pattern is matched
*/
import std.algorithm, std.range, std.stdio;
import core.bitop;
enum PAGESIZE = 4096;
struct BufferedInputRange(R) if(isInputRange!R)
{
alias ElementType!R E;
this(R input)
@MartinNowak
MartinNowak / dget.d
Created May 25, 2012 06:56
github project fetcher
import std.algorithm, std.exception, std.file, std.json, std.path, std.range, std.zip, std.net.curl;
static import std.stdio;
void main(string[] args)
{
bool isSnapshot;
foreach(arg; args[1 .. $])
{
auto outdir = arg.replace("/", "_");
enforce(!outdir.exists, fmt("output folder '%s' already exists", outdir));
import core.atomic, core.memory;
struct WeakRef(T) if(is(T : Object))
{
this(T obj)
{
_ptr = ~cast(size_t)cast(void*)obj;
}
T get()