Skip to content

Instantly share code, notes, and snippets.

namespace Pm.Schema.DataModels.Appointments // Generated by generateMultiple.linq
open System
open System.ComponentModel
open Pm.Schema
open Pm.Schema.BReusable
// typeName:Appointment writeable:false useOptions:false
/// 29 properties
@ImaginaryDevelopment
ImaginaryDevelopment / tasks.json
Created May 3, 2017 13:11
some usable variables inside vscode's tasks
// from https://github.com/orta/vscode-jest/blob/master/.vscode/tasks.json
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process
// A task runner that calls a custom npm script that compiles the extension.
@ImaginaryDevelopment
ImaginaryDevelopment / helloDiscord.fsx
Created October 15, 2018 15:07
Discord Bot F# interactive attempt
#if INTERACTIVE
#r @"C:\Users\bdimp\AppData\Local\LINQPad\NuGet.FW46\BrokenDiscord\Hopac.0.3.23\lib\net45\Hopac.Core.dll";;
#r @"C:\Users\bdimp\AppData\Local\LINQPad\NuGet.FW46\BrokenDiscord\Hopac.0.3.23\lib\net45\Hopac.dll";;
#r @"C:\Users\bdimp\AppData\Local\LINQPad\NuGet.FW46\BrokenDiscord\BrokenDiscord.1.0.0\lib\net461\BrokenDiscord.dll";;
#r @"C:\ProgramData\LINQPad\Updates50\beta\LINQPad.exe";;
#r @"C:\Users\bdimp\AppData\Local\LINQPad\NuGet.FW46\BrokenDiscord\FSharp.Control.AsyncSeq.2.0.21\lib\net45\FSharp.Control.AsyncSeq.dll"
open LINQPad
open BrokenDiscord.Client
open BrokenDiscord.Events
open BrokenDiscord.Types
@ImaginaryDevelopment
ImaginaryDevelopment / FixArrowSizes.cs
Created October 16, 2018 16:18
Demonstrate making a Wpf Frame control's Arrows enlarging
using System.Windows;
using System.Windows.Controls;
void Main()
{
var w = new Window();
var grid = new Grid();
// Func<FrameworkElement,UIElement> getTemplateChild = x => {
// var flags = BindingFlags.NonPublic | BindingFlags.Instance
// var tcm = x.GetType().GetMember("get_TemplateChild", flags)[0] as MethodInfo;
@ImaginaryDevelopment
ImaginaryDevelopment / Main.cs
Created November 1, 2018 19:10
sample calculator interfacing
void Main()
{
var operators = new IOperator[]{
new AdditionOperator()
};
var calc = new Calculator(operators);
calc.InputNumber("1");
calc.Operator = operators[0];
calc.ApplyOperator().Dump();
@ImaginaryDevelopment
ImaginaryDevelopment / M-R.fs
Last active January 4, 2019 21:26
Functional Simple CQRS attempt
// follow Greg Young's simple CQRS pattern - https://www.youtube.com/watch?v=S2KLFlM_Z4I
[<AbstractClass>]
type Event() = class end
type Event<'t>() =
inherit Event()
type Identifier = Guid
type IRepository<'t,'tEvent when 't :> AggregateRoot<'t,'tEvent>> =
abstract member SaveEvents: Identifier -> Event seq -> int -> unit
abstract member GetById : Identifier -> 't option
#probably have to hand-type this script
echo "set clipboard to bidirectional and insert guest additions cdrom"
su - -c "apt-get install sudo curl openssh-server & adduser bdimpe sudo"
su - -c systemctl enable ssh
echo "now you can ssh into this box at :"
ip addr show | grep inet
sudo -i curl -Lo vbox_setup_1.sh https://gist.github.com/ImaginaryDevelopment/30959f86125160e4859856ccfdf98ca0/raw/e80fe50f7461ba0b9801372a6e0526da5f40372b/vbox_setup_1.sh
sudo -i chmod +x vbox_setup_1.sh
sudo -i ./vbox_setup_1.sh
@ImaginaryDevelopment
ImaginaryDevelopment / vbox_setup_1.sh
Last active April 25, 2019 16:23
virtual box setup part deux
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
#apt edit-sources
echo preprending sources list
# would be nice if we ensure this doesn't run multiple times
echo -e " deb http://deb.debian.org/debian stretch main\n deb-src http://deb.debian.org/debian stretch main\n\ndeb http://deb.debian.org/debian stretch-updates main\ndeb-src http://deb.debian.org/debian stretch-updates main\n\n$(cat /etc/sources.list)" > /etc/sources.list
if [ ! -f /usr/sbin/VBoxService ]; then
@ImaginaryDevelopment
ImaginaryDevelopment / blah.txt
Created June 19, 2019 04:12
coh spines fire build
Hero Plan by Mids' Hero Designer 1.962
http://www.cohplanner.com/
The Krab Louse: Level 50 Magic Brute
Primary Power Set: Spines
Secondary Power Set: Fiery Aura
Power Pool: Leaping
Power Pool: Speed
Power Pool: Leadership
Power Pool: Fighting
@ImaginaryDevelopment
ImaginaryDevelopment / knowledge.fs
Created May 7, 2020 17:52
wurm_food-knowledge.py
module Cereal =
// importing a namespace from a referenced package
open Newtonsoft.Json
open Newtonsoft.Json.Linq
let serialize value = JsonConvert.SerializeObject(value)
let deserialize<'t>(raw:string) = JsonConvert.DeserializeObject<'t>(raw)
let read (x:string) = System.IO.File.ReadAllText(x)
open Cereal
let MAX_INGREDIENT_ID = 138