Skip to content

Instantly share code, notes, and snippets.

@swlaschin
swlaschin / type-dependency-graph.fsx
Last active March 4, 2021 19:24
This script analyzes the dependencies between top level types in a .NET Assembly. It is then used to compare the dependency relationships in some F# projects with those in some C# projects.
(*
This script analyzes the dependencies between top level types in a .NET Assembly.
It is then used to compare the dependency relationships in some F# projects with those in some C# projects.
Note that no attempt has been made to optimize the code yet!
REQUIRES:
* Mono.Cecil for code analysis
From http://www.mono-project.com/Cecil#Download
@jeroldhaas
jeroldhaas / Objectives.md
Last active August 29, 2015 14:07
F# Hangout - 2014-10-17

#Objectives / Uses / Possibilities#

F# Hangout Group Ideas.

##Tutorials and Talks##

  • Andrea Magnorsky @silverSpoon wanted to do a presentation on "Game Development in FSharp," and thought that using the hangouts would be a good venue for ad hoc, or informal presentation.
A First Course in Probability
http://www.amazon.com/First-Course-Probability-9th-Edition/dp/032179477X
Probability Theory: The Logic of Science
http://www.amazon.com/Probability-Theory-The-Logic-Science/dp/0521592712
Probability for Statistics and Machine Learning: Fundamentals and Advanced Topics
http://www.amazon.com/Probability-Statistics-Machine-Learning-Fundamentals/dp/B00E6TK8P8/ref=sr_1_2?s=books&ie=UTF8&qid=1420291747&sr=1-2&keywords=Probability+for+Statistics+and+Machine+Learning%3A+Fundamentals+and+Advanced+Topics
@johnazariah
johnazariah / Attempt.fs
Last active August 29, 2015 14:17
Attempt computation expression
open System
[<AutoOpen>]
module Attempt =
type Result<'TSuccess> =
| Success of 'TSuccess
| Failure of Exception
// make sure f is pure, otherwise monad laws will fail
let (>>=) x f =
@swlaschin
swlaschin / ConstrainedTypesExamples.fsx
Last active March 1, 2024 18:19
Examples of creating constrained types in F#
// General hints on defining types with constraints or invariants
//
// Just as in C#, use a private constructor
// and expose "factory" methods that enforce the constraints
//
// In F#, only classes can have private constructors with public members.
//
// If you want to use the record and DU types, the whole type becomes
// private, which means that you also need to provide:
// * a constructor function ("create").
@alimbada
alimbada / Export-Chocolatey.ps1
Last active April 21, 2024 11:39
Export installed Chocolatey packages as packages.config - thanks to Matty666
#Put this in Export-Chocolatey.ps1 file and run it:
#.\Export-Chocolatey.ps1 > packages.config
#You can install the packages using
#choco install packages.config -y
Write-Output "<?xml version=`"1.0`" encoding=`"utf-8`"?>"
Write-Output "<packages>"
choco list -lo -r -y | % { " <package id=`"$($_.SubString(0, $_.IndexOf("|")))`" version=`"$($_.SubString($_.IndexOf("|") + 1))`" />" }
Write-Output "</packages>"
@reidev275
reidev275 / index.html
Last active August 29, 2015 14:26
blog style
<body class="{{body_class}}">
<div class="container">
<nav class="main-nav">
<h1><a href="/">Reid Evans</a></h1>
<p>{{@blog.description}}</p>
<ul>
<li><a href="{{@blog.url}}/about/">About</a></li>
<li><a href="{{@blog.url}}/recent-work/">Recent Work</a></li>
</ul>
</nav>
type BusyBuilder(blockUi, unblockUi) =
member this.Bind(x, f) = async.Bind(x, f)
member this.Combine(e1, e2) = async.Combine(e1, e2)
member this.Delay(f) =
async {
blockUi ()
let! result = async.Delay f
unblockUi ()
return result
}
@spacedoom
spacedoom / tweetwordextractor.fsx
Last active November 16, 2015 13:13
A simple F# script that extracts words from tweets, given a #tag and a date range. Use this script in order to extract words from tweets, given a #hashtag and a date range. Excellent for creating e.g. word clouds! NB You also have to get a copy of the stopwords.txt file (or create your own). Disclaimer: This is not a finished product. There's ro…
#I @"packages\FSharp.Data.Toolbox.Twitter.0.6\lib\net40"
#I @"packages\FSharp.Data.2.1.1\lib\net40"
#r @".\packages\FSharp.Data.Toolbox.Twitter.0.6\lib\net40\FSharp.Data.Toolbox.Twitter.dll"
#r @".\packages\FSharp.Data.2.1.1\lib\net40\FSharp.Data.dll"
open FSharp.Data.Toolbox.Twitter
// Check out https://apps.twitter.com for more info on getting key & secret!
let key = "" //Insert key here!
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 23, 2024 06:15
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###