Skip to content

Instantly share code, notes, and snippets.

View kunjee17's full-sized avatar
💭
Functional Programmer for hire. F#, Scala, Rust. For web, mobile, cloud etc.

Kunjan Dalal kunjee17

💭
Functional Programmer for hire. F#, Scala, Rust. For web, mobile, cloud etc.
View GitHub Profile
@kunjee17
kunjee17 / gist:6461271
Created September 6, 2013 08:55
Lava sample
lut2_1 : lut2 generic map (init => "1000")
portmap (i0 => lava(5), i1 => lava (6),
o => lava(4)) ;
@kunjee17
kunjee17 / cgolf
Created September 6, 2013 08:48
Game of life inf F#
let f s g = g|>List.mapi(fun i x->match Seq.sumBy(fun o->
g.[abs((i+o)%(s*s))])[-1-s;-s;1-s;-1;1;-1+s;s;1+s]with 3->1|2->x|_->0)
@kunjee17
kunjee17 / cgolr
Created September 6, 2013 08:47
Game of life in Ruby
life=->g,s{(0..s*s-1).map{|i|->n{n==3||(g[i]&&n==2)||nil}
[[g[i-s-1],g[i-s],g[i-s+1],g[i-1],g[i+1],g[i+s-1],g[i+s],g[i+s+1]]
.compact.count]}}
@kunjee17
kunjee17 / Programe.fs
Last active December 18, 2015 00:09
F# with Servicestack and Razor viewengine on heroku
// NOTE: If warnings appear, you may need to retarget this project to .NET 4.0. Show the Solution
// Pad, right-click on the project node, choose 'Options --> Build --> General' and change the target
// framework to .NET 4.0 or .NET 4.5.
module ServiceStackHeroku.Main
open System
open System.Collections.Generic
open System.Net
open ServiceStack
open ServiceStack.ServiceInterface