Skip to content

Instantly share code, notes, and snippets.

View YellowAfterlife's full-sized avatar

Vadym Diachenko YellowAfterlife

View GitHub Profile
@YellowAfterlife
YellowAfterlife / FTW.hx
Last active December 28, 2015 11:38 — forked from dpeek/FTW.hx
import haxe.macro.Expr;
import haxe.macro.Context;
class FTW {
public static function build() {
return haxe.macro.Context.getBuildFields().map(transformField);
}
static function transformField(field:Field) {
switch (field.kind) {
@YellowAfterlife
YellowAfterlife / pallete.cpp
Created May 19, 2013 18:43
Outputs a "pallete" of colors achievable via WinAPI SetConsoleTextAttribute
/// Outputs a "pallete" of colors achievable via WinAPI SetConsoleTextAttribute
/// Full article:
/// http://ru.yal.cc/cpp-colored-text-via-winapi/ (Russian)
/// http://yal.cc/cpp-colored-text-via-winapi/ (English)
#include <stdio.h>
#include <Windows.h>
int main(int argc, char* argv[]) {
// foreground and background flags:
int fb[4] = { FOREGROUND_RED, FOREGROUND_GREEN, FOREGROUND_BLUE, FOREGROUND_INTENSITY };
int bb[4] = { BACKGROUND_RED, BACKGROUND_GREEN, BACKGROUND_BLUE, BACKGROUND_INTENSITY };