Skip to content

Instantly share code, notes, and snippets.

View davidwhitney's full-sized avatar
🍸
You're all wonderful. That's what's happening.

David Whitney davidwhitney

🍸
You're all wonderful. That's what's happening.
View GitHub Profile
[{
"name": "Yellow 012 C",
"rgb": {
"r": 255,
"g": 215,
"b": 0
}
}, {
"name": "Bright Red C",
"rgb": {
[{
"name": "100C",
"rgb": {
"r": 246,
"g": 235,
"b": 97
}
}, {
"name": "101C",
"rgb": {
@davidwhitney
davidwhitney / Dojo6.cs
Created May 14, 2020 17:11
Santa Kata
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.ComTypes;
using NUnit.Framework;
namespace dojo6.Test.Unit
{
public class FileParser
{
@davidwhitney
davidwhitney / Cargo.toml
Created May 6, 2020 17:28
Rusty Mars Rover
[package]
name = "rover"
version = "0.1.0"
authors = ["David Whitney <[email protected]>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
import { Code } from "./AsciiArt";
describe("Code", async () => {
let sut;
beforeEach(() => {
sut = new Code();
});
it("A single white pixel returns '.'", async () => {
const result = await sut.makeArtFrom("app/white.jpg");
@davidwhitney
davidwhitney / espruinoflash.sh
Created January 29, 2020 11:52
Flash an ESP32 with Espruino
esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 921600 --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 bootloader.bin 0x8000 partitions_espruino.bin 0x10000 espruino_esp32.bin
@davidwhitney
davidwhitney / NanoJumper.cs
Created January 29, 2020 11:47
NanoFramework Code Example
public class Program
{
public const int DefaultDelay = 1000;
public static void Main() => new Program().Run();
public Program()
{
Console.WriteLine("Constructors are awesome.");
}
@davidwhitney
davidwhitney / IntCodeVm.cs
Last active December 12, 2019 23:52
Advent of Code IntCodeVm C# port
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace IntCodeVmSharp
{
public class IntCodeVm
{
public bool PauseOnOutput { get; set; }
typedef struct {
const char* key;
int value[100];
} key_value_pair;
const auto empty = new key_value_pair();
key_value_pair images[] {
{"snowman", {1, 2, 3, 4, 5} },
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;