Skip to content

Instantly share code, notes, and snippets.

@agauniyal
agauniyal / allocterminal.cpp
Created January 27, 2018 15:26 — forked from kingseva/allocterminal.cpp
Example redirecting cout/stdout to allocated terminal in GUI programs.
#include "rang.hpp"
#include <windows.h>
#include <cstdlib>
void BindStdHandlesToConsole()
{
//TODO: Add Error checking.
// Redirect the CRT standard input, output, and error handles to the console
@agauniyal
agauniyal / TrueColour.md
Created December 11, 2016 19:57 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@agauniyal
agauniyal / g++ test
Created September 1, 2016 07:54 — forked from 13abylon/g++ test
// g++ test.cpp --std=c++11 -lpthread -O2
//#ifdef WIN32 <- stdafx breaks this ifdef...
//#include "stdafx.h"
//#endif
#include <iostream>
#include <atomic>
#include <thread>
#include <vector>

How to Setup emacs irony-mode in Ubuntu-12.04

I recently found a nice emacs-mode, [irony-mode], which can be used with [company-mode], [flycheck-mode], and [eldoc-mode]. It works nicely with CMake-based projects. The document contains a list of instructions for setting things up. I assume that you're using a fresh-installed Ubuntu-12.04.5 (64-bit). It uses [Lean theorem prover][lean] as an example project.