Skip to content

Instantly share code, notes, and snippets.

💕
Tak tak tak tak coding

Billie Thompson PurpleBooth

💕
Tak tak tak tak coding
Block or report user

Report or block PurpleBooth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@PurpleBooth
PurpleBooth / README.md
Last active Sep 30, 2019
The Bowling Kata in Nim Lang!
View README.md

Rules

Create a class with 2 methods:

  • roll(self, pins)
  • score(self)

The rules for scoring are as follows

  • A game is 10 frames
  • Each frame can have up to 2 rolls
  • A spare is when you knock down all pins in a frame
View README.md

Coin Changer Kata

You've just created a virtual vending machine that will dispense widgets of programming goodness when a user puts money into the machine. The machine should dispense the proper change. You now need the programming logic to determine which coins to dispense.

Write a program that will correctly determine the least number of coins to be given to the user such that the sum of the coins' value would equal the correct amount of change.

Interface

Parameters

View README.md

KataTennis

About this Kata

This Kata is about implementing a simple tennis game. I came up with it while thinking about Wii tennis, where they have simplified tennis, so each set is one game.

The scoring system is rather simple:

  1. Each player can have either of these points in one game
View README.md

Mutation Testing

How good are the tests you've been writing all day, and yesterday?

The Command

We're going to use mut.py to run our mutation tests. There are a LOT of options for mutation testing in python, if you find a better one, tell me about it.

Installing mut.py into the environment

View README.md

Mocking Exercises

These are a few exercises to get used to using mocking.

Pairs

Take a list of array elements and group them.

[1, 2, 3, 4, 5]
View Pipfile
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
keras = "*"
tensorflow = "*"
View MessageSenderService.php
<?php
namespace Armakuni\Demo\PhpInserter;
use Google\Cloud\PubSub\PubSubClient;
class MessageSenderService
{
View CounterService.php
<?php
namespace Armakuni\Demo\PhpCounter;
use Google\Cloud\Datastore\DatastoreClient;
class CounterService
{
View command.sh
#!/usr/bin/env bash
docker build -t gcr.io/$(gcloud config get-value project)/simple-example:latest .
docker push gcr.io/$(gcloud config get-value project)/simple-example
gcloud beta run deploy --image gcr.io/$(gcloud config get-value project)/simple-example:latest
View command.sh
#!/usr/bin/env bash
docker build -t image-name .
docker run -e PORT=8080 -p 8080:8080 -d --name container-name image-name
docker logs container-name
curl localhost:8080
docker stop container-name
You can’t perform that action at this time.