Skip to content

Instantly share code, notes, and snippets.

View baronfel's full-sized avatar

Chet Husk baronfel

View GitHub Profile
@baronfel
baronfel / 0.8_spec
Last active August 29, 2015 14:03
Example of a RAML description for a REST API dealing with songs.
#%RAML 0.8
title: World Music API
baseUri: http://example.api.com/{version}
version: v1
traits:
- paged:
queryParameters:
pages:
description: The number of pages to return
type: number
I am thing
namespace parsecccc
module Types =
type PMR =
| Literal of string
| Hostname of string
| Hash of uint32
| IP of string
| Bool of BoolMatch
MELIRA CR 6
XP 2,400
Female human ranger (trapper) 6/sorcerer (wildblooded) 1
(Pathfinder RPG Ultimate Magic 65, 71)
NE Medium humanoid (human)
Init +5 (+7 on water); Senses Perception +10 (+12 on water)
DEFENSE
AC 23, touch 15, flat-footed 18 (+4 armor, +5 Dex, +4 shield)
hp 60 (7 HD; 6d10+1d6+20)
Fort +6, Ref +10, Will +6
@baronfel
baronfel / Config_example.fs
Last active March 28, 2016 19:53
get appsettings and merge from hosting web site
let localSettings = System.Web.Configuration.WebConfigurationManager.AppSettings
let hostSiteSettings = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/Default Web Site") |> Option.ofObj |> Option.map (fun config -> config.AppSettings.Settings)
let allSettings =
seq {
match hostSiteSettings with
| None -> ()
| Some settings ->
for key in settings.AllKeys do
yield (key, settings.[key].Value)
@baronfel
baronfel / recipe.txt
Created April 9, 2016 17:57
Brian's Caesar Salad Recipe
Caesar Salad!
1/8 t dry mustard
1/8t black pepper
1/4t salt
Juice of 1 lemon
3T olive oil
1 egg yolk
1 clove garlic, minced
Anchovy paste, about 1 inch or so
1/3c grated Parmesan
module Foo =
open System
open System.Reflection
// gotta put attributes inside a module, any module, in your Assembly
[<assembly:AssemblyFileVersion("1.0.0")>]
do()
@baronfel
baronfel / sample.fsx
Last active October 31, 2016 20:08
Yaaf.Xmpp.Runtime example
// do note that you'll need to include dependencies in here
module GoogleMessages =
open Yaaf.Xmpp.Runtime
open FSharp.Data
/// types around the messages visible to a mobile client
module ClientFacing =
/// an upstream message is a message that came from a mobile device or web browser
type Upstream = {
From : string
@baronfel
baronfel / api.ts
Created November 18, 2016 16:36
Sample typescript output for file sample
/**
* File Response Test
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 1.0.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
@baronfel
baronfel / ideas.fs
Last active December 2, 2016 02:01
links for uservoice post
/// assumes that this is a 'time' html element
let time (el : IWebElement) = el |> attr "datetime" |> DateTime.Parse
/// used to find things that can be turned into markdown links
let markdownLinkRegex = Regex("(\/ideas\/(\S+))\s*")
/// attempts to rewrite all urls to uservoice to map to the matching issue document on github.
let rewriteUrls (text : string) =
// simple match and replace
let urls = [