Skip to content

Instantly share code, notes, and snippets.

View TWith2Sugars's full-sized avatar
👨‍💻

Tony Williams TWith2Sugars

👨‍💻
View GitHub Profile
static_sites:
- catchall_document: index.html
dockerfile_path: Dockerfile.client
github:
branch: main
deploy_on_push: true
repo:
name: birdshed-app
output_dir: /app/deploy/public/
routes:
type AsyncBuilder with
member __.Bind(computation: System.Threading.Tasks.Task<'a>, binder: 'a -> Async<'b>): Async<'b> =
async {
let! a = Async.AwaitTask computation
return! binder a
}
member __.Bind(computation: System.Threading.Tasks.Task, binder: unit -> Async<unit>): Async<unit> =
async {
do! Async.AwaitTask computation

Keybase proof

I hereby claim:

  • I am twith2sugars on github.
  • I am twith2sugars (https://keybase.io/twith2sugars) on keybase.
  • I have a public key ASAw3AhGiZ1u8IH_015Ouqq98jS5Xub_oF8EKc7Pdm9ybQo

To claim this, I am signing this object:

@TWith2Sugars
TWith2Sugars / build.fsx
Last active January 28, 2016 14:44
Conform all fsproj
#r @"packages/Paket.Core/lib/net45/Paket.Core.dll"
open Paket
open Paket.Xml
open System.Xml
let setProjectAttribute attribute innerText (propertyGroup:Xml.XmlNode) =
let nodes = propertyGroup.ChildNodes |> Seq.cast<XmlNode> |> Seq.filter(fun node -> node.Name = attribute )
nodes |> Seq.iter(propertyGroup.RemoveChild >> ignore)
let attribute = propertyGroup.OwnerDocument.CreateElement(attribute, Constants.ProjectDefaultNameSpace)
@TWith2Sugars
TWith2Sugars / gist:e3633cfec7ed22186881
Created June 2, 2015 11:07
Freya - Server Address
freya {
let! scheme = Freya.getLens Request.scheme
let! host = Freya.getLensPartial Request.Headers.host
let host = host.Value
let! pathBase = Freya.getLens Request.pathBase
let uri = sprintf "%s://%O%s" scheme host pathBase
}
@TWith2Sugars
TWith2Sugars / EventHubProcessor.fs
Last active August 29, 2015 14:16
EventHubProcessor in F#
open Microsoft.ServiceBus
open Microsoft.ServiceBus.Messaging
open Microsoft.WindowsAzure.Storage
open System
open System.Diagnostics
open System.Text
open System.Threading.Tasks
open System.Threading
type Async with
System.Console.ReadLine() |> ignore
@TWith2Sugars
TWith2Sugars / robot.js
Created December 3, 2012 17:13
TWith2Sugars
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if(ev.width == ev.position.x){
public dynamic CreatedBy
{
get
{
return
new
{
FullName = string.Format("{0} {1}", this.user.CreatedByFirstName, this.user.CreatedByLastName),
Id = this.user.CreatedById,
Self = this.Uri("person", this.user.CreatedById)