Skip to content

Instantly share code, notes, and snippets.

@adamchester
adamchester / suaveSerilog.fsx
Created June 8, 2015 11:15
A simple Suave to Serilog adapter
// Step 0. Boilerplate to get the paket.exe tool
open System
open System.IO
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
if not (File.Exists "paket.exe") then
let url = "https://github.com/fsprojects/Paket/releases/download/0.31.5/paket.exe"
use wc = new Net.WebClient()
let tmp = Path.GetTempFileName()
@fernandezpablo85
fernandezpablo85 / git-maven-howto.md
Last active September 22, 2024 11:36
how to create your own maven repository on github

How to create a maven repository for your github project step by step

Clone your project in a separate folder

(note: replace ORGANIZATION and PROJECT)

git clone git clone [email protected]:ORGANIZATION/PROJECT.git my-repository

Cd into it

@GregRos
GregRos / fingertree
Created April 3, 2015 18:30
finger tree!
using Funq.Collections.Common;
using System;
namespace Funq.Collections.Implementation {
static partial class FingerTree<TValue> {
abstract partial class FTree<TChild> {
internal sealed partial class Digit {
public override TExpected Apply<TExpected, TValue2>(int nesting, Func<TValue, TValue2> selector, Lineage lin) {
switch (nesting) {
case 0:
return (TExpected)(object)ApplyTo<Leaf<TValue2>, TValue2>(nesting, selector, lin);
@dfinke
dfinke / ConvertFrom-JsonToCsv.ps1
Created February 16, 2015 14:28
Using PowerShell to Convert From JSON to CSV format
function ConvertFrom-JsonToCsv {
param(
[Parameter(ValueFromPipeline)]
$json
)
Process {
($json | ConvertFrom-Json) | ConvertTo-Csv -NoTypeInformation
}
}
[CmdletBinding()]
[OutputType([System.Management.Automation.PSModuleInfo])]
param(
# The name of the module to install from GitHub.
[Parameter(Position=0, Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[System.String[]]
$ModuleName,
# The scope from which the module should be discoverable.
@isaacabraham
isaacabraham / idiomaticjsonserialiser.fs
Created September 7, 2014 21:17
This JSON.Net converter handles F# discriminated unions with more "idiomatic" JSON than what is generated by the current version of JSON .NET. Option types and single case DUs are transparently handled, and tuple-style properties are used rather than array notation.
namespace Newtonsoft.Json.Converters
open Microsoft.FSharp.Reflection
open Newtonsoft.Json
open System
type IdiomaticDuConverter() =
inherit JsonConverter()
[<Literal>]
@bblfish
bblfish / extractor.scala
Created August 13, 2014 16:50
This extractor works. It starts from a very simple base
package shapeless.examples
import shapeless.PolyDefns._
import shapeless._
import shapeless.ops.hlist.At
import scala.math.Ordering
/**
@walkerjeffd
walkerjeffd / Synology-Diskstation-Git.md
Last active April 24, 2025 13:49
Instructions for setting up git server on Synology Diskstation

Configure Synology NAS as Git Server

Instructions for setting up a git server on a Synology NAS with Diskstation. Specifically, I am using a DS414 with DSM 5.0.

Set Up User and Folder

  • Create user gituser via Diskstation interface (with File Station and WebDAV privilages)
  • Add new shared folder called git (located at /volume1/git) with read/write access for gituser and admin. This folder will hold all the repos.
  • Install Git Server package via Diskstation
@viktorklang
viktorklang / Future-retry.scala
Last active July 23, 2023 23:48
Asynchronous retry for Future in Scala
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext
import scala.concurrent.Future
import akka.pattern.after
import akka.actor.Scheduler
/**
* Given an operation that produces a T, returns a Future containing the result of T, unless an exception is thrown,
* in which case the operation will be retried after _delay_ time, if there are more possible retries, which is configured through
* the _retries_ parameter. If the operation does not succeed and there is no retries left, the resulting Future will contain the last failure.
@MishaelRosenthal
MishaelRosenthal / InviteResponse.scala
Created January 21, 2014 13:17
Usage example for Scala Json writing and reading using Spray. The example includes: Polymorphism, nested case classes, case objects, external libraries classes (FiniteDuration), lists.
package com.liveperson.predictivedialer.common.sessions
import scala.concurrent.duration.FiniteDuration
/**
* User: michaelna
* Date: 1/15/14
* Time: 2:58 PM
*/
object InviteResponse {