Skip to content

Instantly share code, notes, and snippets.

View Art's full-sized avatar

Art Scott Art

View GitHub Profile
open System
type Cylinder =
| FourFourEight
| SixSixTwelve
| ThreeThreeSix
| TwoTwoTwo
type CylinderMeasurement =
{ WidthA: float
@mavnn
mavnn / paket.dependencies
Last active August 29, 2015 14:08
stealing
source https://nuget.org/api/v2
nuget FSharp.Formatting
nuget NUnit
nuget NUnit.Runners
nuget Nuget.CommandLine
nuget FAKE
nuget SourceLink.Fake
github fsharp/FAKE modules/Octokit/Octokit.fsx
@hodzanassredin
hodzanassredin / fun3d.fsx
Last active August 29, 2015 14:22
Tower of Hanoi
let countOfDisks = 10
let initialState = [for x in 1..countOfDisks do yield x], List.empty, List.empty
let bottDiskSize = 4.
let cylHeight = 4.0
let diskSize size = size * bottDiskSize / float(countOfDisks)
let diskHeight = cylHeight / float(countOfDisks)
let diskPosition pos = pos * diskHeight
let cyl =
@7shi
7shi / wpf.fs
Created September 10, 2011 01:47
open System
open System.Windows
open System.Windows.Controls
open System.Windows.Shapes
open System.Windows.Media
let move sh x y =
Canvas.SetLeft(sh, x)
Canvas.SetTop(sh, y)
@fahadsuhaib
fahadsuhaib / F#
Created January 25, 2012 09:50
Pit jQuery integration
/// Pit jQuery API - Experimental version, modifies Pit AST to generate proper jQuery output
document.GetElementById("check")
|> jQuery.ofEl
|> jQuery.attr3 ([|"src","/images/hat.gif";"title","jQuery";"alt","jQuery logo"|])
|> jQuery.css3 ("background","red")
|> jQuery.ignore
@rojepp
rojepp / FsVersion.fs
Created March 14, 2012 00:02
F# Translation for Miguel. I have no idea if this works, and it is pretty much a verbatim translation, only some F# flare added. I didn't dare to do too much refactoring without having a way to test properly. Original: https://github.com/xamarin/monotouch
namespace GLCameraRipple
open System
open System.Drawing
open System.Runtime.InteropServices
//open MonoTouch.CoreFoundation
open Microsoft.FSharp.NativeInterop
type RippleModel(screenSize : Size, meshFactor: int, touchRadius: int, textureSize: Size) =
do Console.WriteLine ("New RippleModel");
let poolWidth = screenSize.Width / meshFactor
@forki
forki / gist:2161484
Created March 22, 2012 18:41
A sample XAML file
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid Name="MainGrid">
<StackPanel Name="StackPanel1">
<Button Name="Button1">First Button</Button>
<Button Name="Button2">Second Button</Button>
</StackPanel>
</Grid>
</Window>
@forki
forki / gist:2161552
Created March 22, 2012 18:43
Starting the WPF app
open System
open System.Windows
open System.Windows.Controls
open FSharpx
type MainWindow = XAML<"Window.xaml">
let loadWindow() =
let window = MainWindow()
window.Button1.Click.Add(fun _ ->
module test
(*
#r "Microsoft.Solver.Foundation.dll";;
#load "test.fs";;
test.computeProblem;;
*)
open Microsoft.SolverFoundation.Common
open Microsoft.SolverFoundation.Services
@CarstenKoenig
CarstenKoenig / Vec.hs
Last active December 19, 2015 16:19
Vec.hs
-- basic implementation of a vector type
-- modeled after the Vec type from Courseras "Coding the Matrix" class
-- | implementation of a sparse-vector representation based on the
-- Courseras "Coding the Matrix" MOOC class
-- this is in no way optimized and is just indended for learning
module Vec where
-- *** I worked with these imports ... you might want others (or not)