Skip to content

Instantly share code, notes, and snippets.

View midned's full-sized avatar
🏠
Working from home

Álvaro C midned

🏠
Working from home
  • Vitech
  • Montevideo
View GitHub Profile
@midned
midned / Signal.cpp
Created March 14, 2015 23:16
c++ signals
#include <vector>
#include <functional>
#include "Signal.h"
template<typename ...Arguments>
void Signal<Arguments...>::connect(std::function<void (Arguments...)> listener) {
listeners.push_back(listener);
}
inline constexpr bool isSpecialScheme(const char* scheme) {
return scheme == "ftp" || scheme == "file" || scheme == "gopher" || scheme == "http" || scheme == "https" || scheme == "ws" || scheme == "wss";
}
@midned
midned / Makefile
Last active July 21, 2016 02:41
Makefile
# Use gcc to compile
CC = gcc
# wildcard allows you to use * to select multiple files on a directory
# $(wildcard gen/logic/*.c) will sellect all files inside gen/logic/ that end with .c
SOURCE_FILES := $(wildcard gen/logic/*.c) $(wildcard gen/display/*.c) $(wildcard man/*.c)
# Now, all object files are stored right where source files are.
# This prevents having trouble when multiple files have the same name but they
# are in different directories. Resulting with .o files with the same name
# inside the obj/ directory.
use std::char;
type Board = [[char; 3]; 3];
static BOARD: Board = [
['C', 'B', 'X'],
['A', 'A', 'A'],
['N', 'N', 'T']
];