Skip to content

Instantly share code, notes, and snippets.

View talentdeficit's full-sized avatar

alisdair sullivan talentdeficit

View GitHub Profile

Problem

A squad of robotic rovers are to be landed by NASA on a plateau on Mars.

This plateau, which is curiously rectangular, must be navigated by the rovers so that their on-board cameras can get a complete view of the surrounding terrain to send back to Earth.

A rover's position is represented by a combination of an x and y co-ordinates and a letter representing one of the four cardinal compass points.

The plateau is divided up into a grid to simplify navigation. An example position might be 0, 0, N, which means the rover is in the bottom left corner and facing North. In order to control a rover, NASA sends a simple string of letters. The possible letters are 'L', 'R' and 'M'. 'L' and 'R' makes the rover spin 90 degrees left or right respectively, without moving from its current spot. 'M' means move forward one grid point, and maintain the same heading.

@talentdeficit
talentdeficit / Makefile
Last active May 28, 2020 05:01
look upon my works and despair
# find all files in vars/
vars = $(wildcard vars/*.tfvars)
# extract env name from vars
envs := $(vars:vars/%.tfvars=%)
# calculate datadir from env name
datadirs := $(envs:%=.terraform/%)
# calculate plan filename from env name
resource "aws_kms_key" "key" {
description = "${var.cluster_name} internal authentication key"
}
data "aws_iam_policy_document" "generate_data_key_permissions" {
statement {
actions = ["kms:GenerateDataKey"]
resources = ["${aws_kms_key.key.arn}"]
}
}
{ "this": "is"
, "objectively":
[ "the"
, "best"
, "way"
]
, "to":
{ "write": "json"
}
}
Bandstock | Remote (San Francisco Based) Elixir / Phoenix Backend Developer (Mid to High Level)
About us :
Bandstock is a digital collectibles game that helps musicians raise money and connect with their fans.
It is a crowdfunding platform, a merch sales platform and a live-music digital collecitbles marketplace
for fans to play and engage with live music venues, performing musicians and other fans in real-time.
We are in the early stages of starting up. Cultivating a working demo of the game is key at this stage.
We are focusing on proof of concept and stunning visuals so we can get investors on board with this
sum(listOfInts) { sum(0, listOfInts); }
sum(acc, listOfInts) {
if length(listOfInts) == 0 { return acc; }
else {
acc += head(listOfInts);
sum(acc, tail(listOfInts);
}
}
import { assert } from "chai";
import axios from "axios";
import "mocha";
import { isUUID } from "validator";
var port = process.env["PORT"] || "8000";
var baseURL = "http://localhost:" + port;
var client = axios.create({
baseURL: baseURL,
defmodule App.Repo.Migrator do
@moduledoc false
@doc false
use GenServer
def start_link() do
GenServer.start_link(__MODULE__, %{}, name: __MODULE__)
end
defmodule App.Repo.Migrator do
@moduledoc false
@doc false
use GenServer
def start_link() do
GenServer.start_link(__MODULE__, %{}, name: __MODULE__)
end
defmodule Whatever.Filter do
alias Whatever.Filter, as: Filter
alias Ecto.Query, as: Query
require Ecto.Query
defstruct valid?: true, query: nil, limit: 1000, errors: []
def filter(%Filter{} = s, { "id", id }) do