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
use std::error; | |
use std::fmt; | |
use std::io::Write; | |
use std::process; | |
#[macro_export] | |
macro_rules! throw { | |
($e:expr) => (return Err($e)) | |
} |
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
tronament.aiModule("shallow-green", function() { | |
var directions = [tronament.NORTH, tronament.EAST, tronament.SOUTH, tronament.WEST]; | |
var iteration = 0; | |
this.onReady = function() { | |
// randomly choose a favored direction for the round | |
directions = shuffle(directions); | |
this.message("Ready, Freddy!"); | |
} |
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
<?php | |
require __DIR__ . "/vendor/autoload.php"; | |
use React\EventLoop; | |
use Slack\ChannelInterface; | |
use Slack\RealTimeClient; | |
$loop = EventLoop\Factory::create(); |
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
<?php | |
/* | |
* Copyright 2015 Stephen Coakley <[email protected]> | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
* use this file except in compliance with the License. You may obtain a copy | |
* of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
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
<?php | |
/* The MIT License (MIT) | |
* | |
* Copyright (c) 2015 Stephen Coakley | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
#!/bin/bash | |
# set up paths and colors | |
BOLD=`tput bold` | |
GREEN=`tput setaf 2` | |
NC=`tput sgr0` | |
LOCAL_PREFIX=$HOME/.usr | |
LOCAL_SRC=$LOCAL_PREFIX/src | |
PROJECT_DIR=`pwd` | |
CPPUNIT_PATH=$PROJECT_DIR/cppunit | |
# use local autotools |
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
Show hidden characters
{ | |
"cmd": ["g++", "-o", "${file_path}/${file_base_name}.exe", "-static-libgcc", "-static-libstdc++", "*.cpp"], | |
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", | |
"working_dir": "${file_path}", | |
"selector": "source.c, source.cpp, source.c++", | |
"path": "c:/Program Files/mingw-w64/mingw64/bin", | |
"shell": true, | |
"variants": [ | |
{ | |
"name": "Run", |
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
<?php | |
/* | |
* Copyright 2014 Stephen Coakley <[email protected]> | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
* use this file except in compliance with the License. You may obtain a copy | |
* of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* |
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 <iostream> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <time.h> | |
using namespace std; | |
int createZombie() { | |
if (rand() % 67 < 10) | |
return 11; |
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
<?php | |
use LogicException; | |
use BadMethodCallException; | |
trait Accessors | |
{ | |
/** | |
* Gets the value of a property. | |
* | |
* @param string $name |
NewerOlder