Skip to content

Instantly share code, notes, and snippets.

View aliak00's full-sized avatar
💭
💩

Ali Akhtarzada aliak00

💭
💩
View GitHub Profile

Keybase proof

I hereby claim:

  • I am aliak00 on github.
  • I am aliak (https://keybase.io/aliak) on keybase.
  • I have a public key ASApajlvW-T7gDaEsxnScoNSJCFso6QrWCDDFGos2YeK1Ao

To claim this, I am signing this object:

@aliak00
aliak00 / hasNonTrivialCopyConstructor.d
Created August 3, 2019 18:39
checks for copy ctor using __parameters
template hasNonTrivialCopyConstructor(T) {
bool isCopyConstructorFor(alias ctor, T)() {
// Specialized function that checks specifically for "ref" in a string
bool containsRef(string str) {
foreach (i, c; str) {
if (c == 'r') {
if (i + 2 < str.length) {
return str[i + 1] == 'e' && str[i + 2] == 'f';
}
}
@aliak00
aliak00 / func_wrap_compare.d
Last active July 5, 2019 13:26
Comparing functions in wrappers
import std.stdio;
template isTransformedWrapper(W) {
enum isTransformedWrapper = is(W : TrasformedWrapper!T, T...);
}
struct Wrapped(T) {
T value;
}
@aliak00
aliak00 / brew-patch-dmd.sh
Created November 7, 2018 22:56
If you ever feel the need to update dmd for homebrew
#!/usr/bin/env bash
#
# This is just convenience to make updating dmd for homebrew a one liner (ish)
# You still need to "git commit" the changes and push and make a PR.
#
show_help() {
echo "usage: $(basename "$0") -f <brew-fork-dir> -v <released-dmd-version>"
}
@aliak00
aliak00 / profiler.swift
Last active June 7, 2017 06:44
A profiler that measures performance across threads for Swift
/*
Copyright 2017 Ali Akhtarzada
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0