This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio, std.format; | |
interface MetaDlangObject { | |
const enum string eval(); | |
} | |
interface MetaDlangExpr : MetaDlangObject { | |
} | |
interface MetaDlangStatement : MetaDlangObject { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
import std.typecons; | |
import std.conv; | |
class DFA(Q, Sigma) { | |
Q q0; | |
Q[] F; | |
Q[Tuple!(Q, Sigma)] delta; | |
this(Q[Tuple!(Q, Sigma)] delta, Q q0, Q[] F) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name AppleMusicTools | |
// @namespace https://alpha-kai-net.info | |
// @version 0.1 | |
// @description Useful Apple Music User Script | |
// @author alphaKAI | |
// @match https://beta.music.apple.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
import std.conv; | |
import std.string; | |
struct Regs { | |
uint a, b, c, d; | |
} | |
Regs cpuid(uint eax) { | |
Regs r; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, Copy, Clone, PartialEq)] | |
enum VMIns { | |
Push(i32), | |
Add, | |
Sub, | |
Mul, | |
Div, | |
Println, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: all test clean | |
CC := cc | |
CFLAGS := -Wextra -Wall -g | |
TARGET = cplayground | |
SRCS = \ | |
$(shell find ./ -maxdepth 1 -name "*.c") \ | |
$(shell find ./sds -name "*.c") | |
OBJS = $(shell find ./ -name "*.o") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Ruby embedded into D. | |
compile: dmd rbd.d -L-L/path/to/ruby/lib -L-lruby.2.6 | |
Example... dmd rbd.d -L-L/usr/local/opt/ruby/lib -L-lruby.2.6 | |
*/ | |
import std.stdio, | |
std.string; | |
extern (C) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Python3 Embedded into D. | |
compile: $ dmd py3d.d -L-L/Path/To/Python3LibDirectory -L-lpython3.7m | |
Example... | |
dmd py3d.d -L-L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -L-lpython3.7m | |
*/ | |
import std.stdio, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module avl; | |
import std.stdio; | |
import std.typecons; | |
string string_rep(string s, size_t n) { | |
string ret; | |
foreach (_; 0 .. n) { | |
ret ~= s; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define INNNER_FUNC_PROT(N, RET, func_prot) \ | |
func_prot; \ | |
RET inner_func_ ##N ## _next(); | |
#define INNNER_FUNC_DEF(N, RET, func_name, func_def) \ | |
func_name (); \ | |
return inner_func_ ## N ## _next(); \ | |
} \ |