Skip to content

Instantly share code, notes, and snippets.

ssh -oStrictHostKeyChecking=no root@...
\
apt update &&
apt upgrade -y &&
apt install gcc -y &&
curl -fsS https://dlang.org/install.sh | bash -s dmd
module owl_delivery.GET;
import owl_delivery;
auto GET(string url, Duration duration = seconds(1))
{
string result;
auto
http = HTTP(url);
http.operationTimeout(duration);
void main()
{
string result;
import std.net.curl;
auto
http = HTTP("https://robinhood.com/404.html");
http.onReceive((ubyte[] data) { result = cast(string) data; return data.length; });
http.perform();
import std.traits, std.format, std.string, std.stdio;
void main()
{
foo();
}
enum printLiterals = q{
alias ParameterIdentifierTuple!(mixin(__FUNCTION__)) idents;
import std.array, std.stdio;
enum trace = q{version(verbose)
{
writefln("%s> %s", "-".replicate(++depth), split(__PRETTY_FUNCTION__, ".")[$ - 1]); scope(exit)
writefln("<%s %s", "-".replicate(depth--), split(__PRETTY_FUNCTION__, ".")[$ - 1]);
}};
ulong depth;
import std.stdio, core.stdc.stdlib;
void main()
{
}
/+
cache
+/
static struct cache
@zaydek-old
zaydek-old / a.d
Created August 8, 2017 20:55
my issue with modules
module a;
void a()
{
import std.stdio;
writeln("hello, world!");
}
@zaydek-old
zaydek-old / a2.d
Created August 8, 2017 20:59
my solution
void a()
{
import std.stdio;
writeln("hello, world!");
}
@zaydek-old
zaydek-old / a1.d
Created August 8, 2017 21:02
identical imports
import std.stdio;
void main()
{
writeln("hello, world!");
}