This file contains 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
use std::char; | |
type Board = [[char; 3]; 3]; | |
static BOARD: Board = [ | |
['C', 'B', 'X'], | |
['A', 'A', 'A'], | |
['N', 'N', 'T'] | |
]; |
This file contains 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
# 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. |
This file contains 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
inline constexpr bool isSpecialScheme(const char* scheme) { | |
return scheme == "ftp" || scheme == "file" || scheme == "gopher" || scheme == "http" || scheme == "https" || scheme == "ws" || scheme == "wss"; | |
} |
This file contains 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 <vector> | |
#include <functional> | |
#include "Signal.h" | |
template<typename ...Arguments> | |
void Signal<Arguments...>::connect(std::function<void (Arguments...)> listener) { | |
listeners.push_back(listener); | |
} |
This file contains 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 <iostream> | |
#include <vector> | |
using namespace std; | |
int main(int argc, char* argv[]) { | |
int opcion; | |
int numero; |
This file contains 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
setInterval(function(){ | |
document.body.style.background = 'rgba('+Math.floor(Math.random()*255)+', '+Math.floor(Math.random()*255)+', '+Math.floor(Math.random()*255)+', 1)'; | |
},50); |
This file contains 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
Node.prototype.on = Node.prototype.addEventListener; | |
Node.prototype.off = Node.prototype.removeEventListener; | |
var elem = document.getElementById('some-element'); | |
function yolo(){ | |
console.log('yolo'); | |
} | |
elem.on('click', yolo); |
This file contains 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
function $(selector, context) | |
{ | |
if (!(context instanceof Element)) { | |
context = document; | |
} | |
return context.querySelectorAll(selector); | |
} | |
// querySelectorAll() returns a NodeList object so we need to get the first one |
This file contains 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
(coffee -o ../assets/js -cw coffee) & (jade -w -P jade/index.jade --out ../) & (stylus --out ../assets/css -w stylus) & |
This file contains 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
# Create the router that will handle routes to 'site.com/app' | |
router = new Routy.Router 'app' | |
# also you can: | |
# router = new Routy.Router 'app', 'a.routy-link' | |
# to only listen clicks to links with the "routy-link" class | |
# or: | |
# router = new Routy.Router 'app', null, '#container' | |
# to listen clicks for every link inside the element with the "container" id | |
# this will handle 'app/' and 'app/home' |
NewerOlder