Skip to content

Instantly share code, notes, and snippets.

View markcoleman's full-sized avatar

Mark Coleman markcoleman

View GitHub Profile
@markcoleman
markcoleman / robot.js
Created December 5, 2012 14:59 — forked from Shipow/robot.js
Shipow#001
var Robot = function(robot) {
robot.rotateCannon(-90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead();
//i'll add a clone but i need to refactor collision
//robot.clone();
};
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(50);
@markcoleman
markcoleman / robot.js
Created December 6, 2012 13:15 — forked from Ghabriel/robot.js
Robot04
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.rotateCannon(360);
@markcoleman
markcoleman / robot.js
Created December 6, 2012 14:22 — forked from bchoii/robot.js
First Try
var Robot = function(robot) {
//\ robot.clone();
// this.mode = 'scanning';
};
var mode = 'scanning';
var targetVector = 0;
var lastFired = 0;
var iteration = 0;
@markcoleman
markcoleman / robot.js
Created December 6, 2012 14:22 — forked from bchoii/robot.js
First Try
var Robot = function(robot) {
//\ robot.clone();
// this.mode = 'scanning';
};
var mode = 'scanning';
var targetVector = 0;
var lastFired = 0;
var iteration = 0;
@markcoleman
markcoleman / robot.js
Created December 6, 2012 14:22 — forked from bchoii/robot.js
First Try
var Robot = function(robot) {
//\ robot.clone();
// this.mode = 'scanning';
};
var mode = 'scanning';
var targetVector = 0;
var lastFired = 0;
var iteration = 0;
@markcoleman
markcoleman / robot.js
Created December 6, 2012 14:22 — forked from bchoii/robot.js
First Try
var Robot = function(robot) {
//\ robot.clone();
// this.mode = 'scanning';
};
var mode = 'scanning';
var targetVector = 0;
var lastFired = 0;
var iteration = 0;
@markcoleman
markcoleman / config is not needed thanks @Grumpydev
Last active December 10, 2015 21:28
NancyFX Bootstrapper with Unity and Json.Net Json.Net is also configure with CamelCaseProperyNameContractResolver()
public class Bootstrapper : UnityNancyBootstrapper
{
protected override void RegisterTypes(IUnityContainer container, IEnumerable<TypeRegistration> typeRegistrations)
{
base.RegisterTypes(container, typeRegistrations);
container.RegisterInstance(
JsonSerializer.Create(new JsonSerializerSettings()
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
}));
@markcoleman
markcoleman / gist:4627686
Created January 24, 2013 21:01
Fix for our CI server when using NancyFX Testing
public class TestableBootstrapper : ConfigurableBootstrapper
{
public TestableBootstrapper(Action<ConfigurableBoostrapperConfigurator> action): base(action)
{
}
protected override byte[] FavIcon
{
get
@markcoleman
markcoleman / currency wrapper
Created February 26, 2013 21:00
Simple AngularJs directive that adds a positive and negative class to the element, using the built in currency filter
angular.module('homeBanking.directives', [])
.directive("hbCurrency", ($filter: ng.IFilterService) => {
return {
restrict: "EAC",
require: "?$filter",
link: function ($scope: ng.IScope, elm, attrs) {
var currencyFilter = $filter('currency'),
rawAmount = $scope.$eval(attrs.hbCurrency),
className = rawAmount >= 0 ? "positive" : "negative";