Skip to content

Instantly share code, notes, and snippets.

View KenBonny's full-sized avatar
🤔
Wondering why this code doesn't work

Ken Bonny KenBonny

🤔
Wondering why this code doesn't work
View GitHub Profile
@KenBonny
KenBonny / generate-rows.fsx
Last active January 5, 2024 16:37
One Billion Rows F#
open System
open System.Diagnostics
open System.IO
[<Literal>]
let file = "./measurements.csv"
let stations = [
"Abha"
"Abidjan"
"Abéché"
@KenBonny
KenBonny / ddd-roller.fsx
Last active July 19, 2023 15:13
Dice roller script
open System
open System.Text.RegularExpressions
type Operation =
| Add
| Subtract
type Dice = { Amount: int; Sides: int }
type Modification =
/// +--------------------------------------+
/// | |
/// | Decider |
/// | |
/// | Jérémie Chassaing |
/// | @thinkb4coding |
/// +--------------------------------------+
// A decider is a structure define by 7 parameters:
@KenBonny
KenBonny / set-fastmail-dns-in-cloudflare.fsx
Created March 12, 2022 10:55
A script to create Fastmail DNS records in Cloudflare
// resources used:
// https://api.cloudflare.com/#dns-records-for-a-zone-create-dns-record
// https://www.fastmail.help/hc/en-us/articles/360060591153-Domains-Advanced-configuration
#r "nuget: Flurl.Http, Version=3.2.2"
#r "nuget: Newtonsoft.Json, Version=13.0.1"
open Flurl
open Flurl.Http
open System
using System;
using Newtonsoft.Json;
using Shouldly;
using Xunit;
namespace TestSolution.UnitTests
{
public class ImplicitConversionTests
{
private const string ExampleNumber = "+32 1234 567 890";
@KenBonny
KenBonny / powershell_profile.ps1
Last active November 26, 2022 14:11
powershell_profile.ps1
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
# using this script expects that a nerd font is installed: https://www.nerdfonts.com/
# and configured in the terminal app that you use
# it also expects that the module Terminal-icons is installed
# Install-Module -Name Terminal-Icons -Repository PSGallery
Import-Module -Name Terminal-Icons
@KenBonny
KenBonny / windows-terminal-settings.json
Last active May 15, 2021 11:39
settings for my windows terminal
// This file was initially generated by Windows Terminal 1.7.1033.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@KenBonny
KenBonny / ken.json
Last active October 5, 2023 15:26
powershell customisation scripts
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#FEF5ED",
"foreground": "#011627",
"properties": {
using Xunit;
using Xunit.Abstractions;
namespace KenBonny.TestProject.Tests
{
public class CtorTests
{
private readonly ITestOutputHelper _console;
public CtorTests(ITestOutputHelper console)
@KenBonny
KenBonny / gist:2112b48214811d0123feb89e44bf307a
Created December 27, 2017 15:37
DebuggerDisplayAttribute experiment
public class DebuggerAttributeTests
{
[Fact]
public void DebuggerTests()
{
var person = new Person
{
Id = 1,
Name = "Ken Bonny",
Birthday = new DateTime(1987, 1, 1)