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
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
namespace Pen.Loader
{
public class QuillData
{
public QuillData(string dbrFilePath)
{
using System;
using System.Net;
using System.Net.Http;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Routing;
using Microsoft.Owin.Hosting;
using Owin;
class Program
{
static void Main(string[] args)
{
var spinner = new Spinner();
spinner.Start(0, 0);
Console.WriteLine("Hello World!" + Console.BufferHeight);
Console.WriteLine("Hello World!" + Console.BufferHeight);
@davidwhitney
davidwhitney / RowWithSchema.java
Last active March 26, 2019 11:27
Create Spark Row in Java for tests etc
package com.gfk.igl.insights.processor.spark.builders;
import lombok.var;
import org.apache.spark.sql.Row;
import org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema;
import org.apache.spark.sql.types.DataTypes;
import org.apache.spark.sql.types.StructField;
import org.apache.spark.sql.types.StructType;
@davidwhitney
davidwhitney / Container.java
Last active September 6, 2019 06:15
Container.java - a feature rich DI container in 339 LOC
package com.electricheadsoftware.tinycontainer;
import lombok.Data;
import lombok.Getter;
import lombok.var;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
@davidwhitney
davidwhitney / LICENSE.txt
Last active October 7, 2019 21:14
A Tiny Typescript mocking... um... library? class? That doesn't annoy me, and doesn't cause Typescript linters to get confused or fill your code up with :anys. The license is MIT.
Copyright (c) 2019 David Whitney
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
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@davidwhitney
davidwhitney / gilded-rose.ts
Last active October 21, 2019 23:09
A Typescript version of the guilded rose
export class Item {
name: string;
sellIn: number;
quality: number;
constructor(name: string, sellIn: number, quality: number) {
this.name = name;
this.sellIn = sellIn;
this.quality = quality;
}
@davidwhitney
davidwhitney / setup.ps1
Last active April 10, 2024 10:54
Machine setup chocolatey script
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco feature enable -n allowGlobalConfirmation
choco install notepad2
choco install notepadplusplus
choco install 7zip
choco install paint.net
choco install autoruns
choco install vcredist140
choco install dotnetfx
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;
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} },