Skip to content

Instantly share code, notes, and snippets.

Tuomas Hietanen Thorium

Block or report user

Report or block Thorium

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mathias-brandewinder
mathias-brandewinder / Script.fsx
Created Aug 9, 2015
Language Safety Score using Logistic Regression
View Script.fsx
(*
This is a reaction to this blog post by Steve Shogren:
http://deliberate-software.com/safety-rank-part-2/
*)
#I @"../packages"
#r @"Accord.3.0.1-alpha\lib\net45\Accord.dll"
#r @"Accord.MachineLearning.3.0.1-alpha\lib\net45\Accord.MachineLearning.dll"
#r @"Accord.Math.3.0.1-alpha\lib\net45\Accord.Math.dll"
#r @"Accord.Statistics.3.0.1-alpha\lib\net45\Accord.Statistics.dll"
@PatrickJS
PatrickJS / rxPipeRegistry.ts
Last active Nov 12, 2015
rx support for Angular 2 Async Pipe
View rxPipeRegistry.ts
/// <reference path="../../typings/tsd.d.ts" />
///
import {PipeFactory} from 'angular2/src/change_detection/pipes/pipe';
import {async} from 'angular2/src/change_detection/change_detection';
import {NullPipeFactory, Pipe, PipeRegistry, defaultPipes} from 'angular2/change_detection';
import {bind} from 'angular2/di';
import {ObservablePipe} from 'angular2/pipes';
import * as Rx from 'rx';
export function isObservable(obs) {
View gist:98e7884fde511bcf4eaa
//==========================================
// Working fully self-contained getting-started example for Suave Web Server scripting
//
// Note you don't need to have _anything_ installed before starting with this script. Nothing
// but F# Interactive and this script.
//
// This script fetches the Paket.exe component which is referenced later in the script.
// Initially the #r "paket.exe" reference is shown as unresolved. Once it has been
// downloaded by the user (by executing the first part of the script) the reference
// shows as resolved and can be used.
@dsyme
dsyme / gist:9b18608b78dccf92ba33
Last active May 24, 2019
Working self-contained getting-started sample for Suave Web Scripting
View gist:9b18608b78dccf92ba33
//==========================================
// Working fully self-contained getting-started example for Suave Web Server scripting
//
// Note you don't need to have _anything_ installed before starting with this script. Nothing
// but F# Interactive and this script.
//
// This script fetches the Paket.exe component which is referenced later in the script.
// Initially the #r "paket.exe" reference is shown as unresolved. Once it has been
// downloaded by the user (by executing the first part of the script) the reference
// shows as resolved and can be used.
@junosuarez
junosuarez / Dockerfile
Last active Dec 19, 2015
F# 3.0 in a Docker image
View Dockerfile
# DOCKER-VERSION 0.4.8
FROM base:ubuntu-12.10
RUN apt-get -y install mono-devel autoconf pkg-config make git libtool
RUN git clone https://github.com/fsharp/fsharp
RUN cd fsharp && ./autogen.sh --prefix /usr && make && make install
@ferventcoder
ferventcoder / setup.ps1
Last active Aug 18, 2019
Really rocking out the environment setup
View setup.ps1
$scriptDir = $(Split-Path -parent $MyInvocation.MyCommand.Definition)
function Install-NeededFor {
param(
[string] $packageName = ''
,[bool] $defaultAnswer = $true
)
if ($packageName -eq '') {return $false}
$yes = '6'
@forki
forki / gist:1400378
Created Nov 28, 2011
Poor mans type classes
View gist:1400378
// Mimic type classes with additional param
type 'a Num = {
zero: 'a
add: 'a -> 'a -> 'a
mult: 'a -> 'a -> 'a
fromInteger: int -> 'a }
let intNum = {
zero = 0
@AndrewNewcomb
AndrewNewcomb / WebSocketServer.fs
Last active Jan 9, 2017
OLD from 2010 ... Updated example of using F# MailboxProcessor against an HTML5 WebSocket (in Google Chrome)
View WebSocketServer.fs
// Example of using F# MailboxProcessor against an HTML5 WebSocket (in Google Chrome)
// taken from http://v2matveev.blogspot.com/2010/04/mailboxprocessors-practical-application.html
// and then modified to work with the revised WebSocket protocol that includes a set of challenge bytes.
// The main changes are in the handshake function.
// Have a look at the http://nugget.codeplex.com for example WebSocket code in C#, on which I based the
// challenge processing code.
open System
open System.IO
open System.Linq
You can’t perform that action at this time.