Skip to content

Instantly share code, notes, and snippets.

@neoeinstein
neoeinstein / LogentriesSink.fs
Created October 23, 2015 03:26
My in-progress attempt at creating a sink for serilog to logentries, which I halted after finding the JSON formatter.
module Logentries =
open System.IO
open System.Net.Sockets
open System.Net.Security
type Connection =
private
{ Client : TcpClient
Stream : Stream }
interface System.IDisposable with
@neoeinstein
neoeinstein / 0___rust_serde_json_wasm_parcel___0.md
Created January 26, 2018 17:18 — forked from asaaki/0___rust_serde_json_wasm_parcel___0.md
Rust-to-JS JSON string exchange (parcel.js, wasm)

Rust, serde-json, wasm, parcel.js

With this combination it is fairly easy to get things done in Rust and utilize it in JavaScript. Yay!

@neoeinstein
neoeinstein / proptest_fix.sh
Created June 3, 2019 16:30
Wrapper for rustc that handles problems when trying to compile `proptest` with `cargo-tarpaulin` (or in general when using `-C link-dead-code`). Used by setting `RUSTC_WRAPPER=proptest_fix.sh` before executing `cargo-tarpaulin`.
#!/usr/bin/env bash
set -euo pipefail
ARGS=$@
CARGO_HOME=${CARGO_HOME-}
CARGO_PKG_NAME=${CARGO_PKG_NAME-}
if [[ "$CARGO_PKG_NAME" = "proptest" ]]
then
@neoeinstein
neoeinstein / Abort-AwsGlacierMultipartUpload.ps1
Created August 23, 2012 15:19
Powershell script to upload an archive to AWS Glacier with multipart retry and resume
<#
.SYNOPSIS
Aborts a multipart upload to an Amazon Web Services Glacier vault.
.DESCRIPTION
Abort-AwsGlacierUpload aborts a multipart upload to an AWS Glacier vault. After an upload is successfully aborted no further parts may be uploaded for that upload request.
.PARAMETER VaultName
Name of the Glacier vault in which the upload was initiated.
@neoeinstein
neoeinstein / transition.md
Created January 4, 2018 23:40
PGP Key Transition

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256

Date: January 4, 2018

For a number of [reasons][0], I, Marcus Griep, have recently set up a new OpenPGP key, and will be transitioning away from my old one.

The old key will continue to be valid for some time, but I prefer all future correspondence to come to the new one. I would also like this

@neoeinstein
neoeinstein / EventStore.fs
Last active June 14, 2017 05:59
EventStore projections from Fable. A noble attempt.
namespace Fable.Import
open System
open Fable.Core
open Fable.Import.JS
module EventStore =
type [<Erase>] Initializer<'state> = unit -> 'state
type [<Erase>] EventHandler<'state,'event> = System.Func<'state,EventEnvelope<'event>,'state>
and [<Erase>] EventHandler<'state,'event,'metadata> = System.Func<'state,EventEnvelope<'event,'metadata>,'state>
@neoeinstein
neoeinstein / Api.fs
Created April 11, 2017 15:27
Minimal example resulting in a 410 Gone response
module Api
open Freya.Machines.Http
let root = HttpMachine.Freya <| freyaMachine {
exists false
gone true
}
@neoeinstein
neoeinstein / Auth0.elm
Last active March 2, 2017 08:22
Elm Example for interoperating with Auth0. Note that much of this was culled out of an existing code-base, so may need some minor edits to work correctly for you. Presumes that Elm.Main is transpiled into elm.js
module Auth0
( AuthenticationState(..), AuthenticationError, AuthenticationResult
, Options, defaultOpts
, LoggedInUser, UserProfile, Token
, showLock, showLockSignal
, mapResult
) where
@neoeinstein
neoeinstein / OptionModule_Decompiled.cs
Last active November 22, 2016 18:03
A decompiled version of the `Option` module fin FSharp.Core, along with the correlating IL. Produced with dotPeek 2016.2.2
// Decompiled with JetBrains decompiler
// Type: Microsoft.FSharp.Core.OptionModule
// Assembly: FSharp.Core, Version=4.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// MVID: 58348223-904C-F4DA-A745-038323823458
// Assembly location: C:\dev\neoeinstein\visualfsharp\release\net40\bin\FSharp.Core.dll
// Compiler-generated code is shown
// IL code is shown in comments
using Microsoft.FSharp.Collections;
using System;
@neoeinstein
neoeinstein / Dockerfile
Last active October 6, 2016 03:53
Freya on .NET Core Proof of Concept
FROM debian:jessie
EXPOSE 8080
RUN apt-get update && \
apt-get install -y libunwind8 libicu52 && \
rm -rf /var/lib/apt/lists/*
ADD bin/Release/netcoreapp1.3/debian.8-x64/publish/* /usr/local/lib/freya-svc/
ENTRYPOINT /usr/local/lib/freya-svc/freya-poc