Skip to content

Instantly share code, notes, and snippets.

module container.linkedaa;
pragma(inline, true):
struct LinkedAssociativeArray(Key, Value)
{
// Initialize a LinkedAssociativeArray with an AssociativeArray.
// For supporting `aa = [key1:value1, key2:value2, ...]` syntax.
this(AssociativeArray!(Key, Value) aa) pure nothrow
{
@ibuclaw
ibuclaw / invariant.cpp
Last active December 30, 2022 15:27 — forked from GavinRay97/invariant.cpp
GCC [[invariant]] plugin for Design by Contract (WIP)
#include <iostream>
// clang-format off
#include <gcc-plugin.h>
#include <context.h>
#include <plugin-version.h>
#include <tree.h>
#include <gimple.h>
#include <tree-pass.h>
#include <gimple-iterator.h>
@ibuclaw
ibuclaw / release.sh
Last active May 9, 2024 13:07 — forked from MartinNowak/release.sh
Orchestration for dlang release building
#!/usr/bin/env bash
set -ueo pipefail
set -x
ROOT="$PWD"
LATEST_D_VER=v$(curl -fsS http://downloads.dlang.org/releases/LATEST)
BUILD_LDC_VER=v1.32.0
D_VER=v2.109.0-beta.1
@ibuclaw
ibuclaw / OSX-10.13.ova
Last active October 11, 2022 21:37 — forked from MartinNowak/OSX-10.8.ova
curl follow redirects
#!/bin/sh
# Minimal wrapper around dmd in order to build gdc-12+
# ../configure --enable-languages=d GDC=dgdc.sh
TRANSLATED_ARGS=
while [ $# -gt 0 ]; do
case "$1" in
-frelease)
TRANSLATED_ARGS="${TRANSLATED_ARGS} -release"
shift
;;
@ibuclaw
ibuclaw / lgdc.sh
Last active May 6, 2022 11:09
lgdc
#!/bin/sh
# Minimal wrapper around ldc2 in order to build gdc-12+
# ../configure --enable-languages=d GDC=lgdc.sh
TRANSLATED_ARGS=
while [ $# -gt 0 ]; do
case "$1" in
-fPIC)
TRANSLATED_ARGS="${TRANSLATED_ARGS} --relocation-model=pic"
shift
;;
import std.stdio, std.file, std.path, std.range, std.string, std.algorithm ;
string[] filterList = ["./Makefile.in", "./Makefile.am", "./index.d", "./unittest.d",
"./libgphobos.spec.in", "./LICENSE_1_0.txt", "./std/experimental/note.md"];
struct Files
{
string[] baseList;
string[][string] sysList;
}
@ibuclaw
ibuclaw / sources.d
Last active August 1, 2017 08:20 — forked from jpf91/sources.d
import std.stdio, std.file, std.path, std.range, std.string, std.algorithm ;
string[] filterList = ["./Makefile.in", "./gcc/config.d.in", "./gcc/libbacktrace.d.in",
"./Makefile.am", "./LICENSE", "./rt/dylib_fixes.c"];
struct Files
{
string[] baseList, cppList, gcList, gcStubList;
string[][string] sysList;
}
#!/bin/bash
rm -rf stage1
rm -rf stage2
rm -rf stage3
# Stage 1
make -j8 -f posix.mak CC=g++-4.9 HOST_DMD=gdmd
mkdir stage1
mv dmd stage1/dmd
@ibuclaw
ibuclaw / gol.d
Created February 22, 2011 19:22 — forked from paultag/gol.c
import std.stdio;
import core.stdc.limits;
import std.math;
uint WORLD;
uint LASTWORLD;
uint NEWWORLD;
uint ROW_L;