Why?
There are multiple extensions that claim to do this, but I didn't find one that was working in incognito mode.
Steps:
- Go to chrome://discards/
- Open the DevTools and click on the Console tab (or press [Esc])
void main() | |
{ | |
import core.time : MonoTime; | |
import std.stdio : stdin, writef; | |
import std.string : wrap; | |
const start = MonoTime.currTime; | |
foreach (line; stdin.byLineCopy) | |
{ | |
const now = MonoTime.currTime; | |
const diff = now - start; |
unittest | |
{ | |
shared Atomic!int ai; | |
assert(ai.get == 0); // atomicLoad / std::atomic<T>::load | |
ai = 5; // atomicStore via opAssign / std::atomic<T>::operator= | |
assert(ai.get == 5); // atomicLoad | |
assert(ai.exchange(3) == 5); // atomicExchange / std::atomic<T>::exchange | |
assert(ai.get == 3); // atomicLoad | |
assert(ai.cas(3, 42)); // cas / std::atomic<T>::compare_exchange_strong | |
assert(ai.get == 42); // atomicLoad |
void main() | |
{ | |
static immutable pairs = [__traits(allMembers, Pair)]; | |
pragma (msg, pairs); // ["EURUSD", "GBPUSD", "USDCHF", "XAUUSD"] | |
import std.stdio : writeln; | |
"EURUSD".parseEnum!Pair.writeln; | |
"GBPUSD".parseEnum!Pair.writeln; | |
"USDCHF".parseEnum!Pair.writeln; |
void main() | |
{ | |
import std.stdio : writeln; | |
static struct Vec3 | |
{ | |
float x, y, z; | |
} | |
auto soa = SoA!Vec3(5); |
void main() | |
{ | |
throw globalInstance!Error("This is an Error()", null); | |
} | |
T globalInstance(T, bool tls = true, Args...)(auto ref Args args) | |
if (is(T == class)) | |
{ | |
// There really should be a trait for this: | |
enum classAlignment = 2 * (void*).sizeof; // until then, here's a reasonable guess :) |
{ pkgs ? import <nixpkgs> { } }: | |
with pkgs; | |
mkShell { | |
buildInputs = [ | |
fish | |
git | |
nodejs-12_x | |
(yarn.override { nodejs = nodejs-12_x; }) | |
gnumake | |
python3 |
import std.exception : enforce; | |
import std.format : format; | |
import std.file : exists, getcwd, isDir, isFile; | |
import std.path : absolutePath, buildNormalizedPath, dirName, relativePath; | |
import std.stdio : writeln, writefln; | |
import std.range; | |
void main(string[] args) | |
{ | |
enforce(args.length == 2, "Usage:\n\tabs_to_rel_git_path <path>"); |
bool invariantsEnabled() @trusted nothrow pure | |
{ | |
static struct HasInvariant | |
{ | |
@safe pure: | |
invariant { throw new Exception("From invariant"); } | |
void triggerInvaraint() { } | |
} | |
try | |
HasInvariant().triggerInvaraint(); |
extern(C) void _start() { | |
static if ("a" == "a") {} | |
} |