Skip to content

Instantly share code, notes, and snippets.

View khellang's full-sized avatar

Kristian Hellang khellang

View GitHub Profile
@khellang
khellang / ReallyDisableUAC.reg
Created September 9, 2014 11:00
Disable UAC
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLUA"=dword:00000000
@khellang
khellang / Game.fs
Created September 9, 2014 17:52
Tennis Kata - Implemented in F#, tests are using FsUnit with Xunit
namespace Tennis
module Game =
type State = {
a: int;
b: int;
}
let callEqualScore score =
@khellang
khellang / Program.fs
Created September 10, 2014 23:00
Parse all Vinmonopolet stores and save them to database using EF
open FSharp.Data
open System
open System.Diagnostics
open Vinmonopolet.Core
type Stores =
CsvProvider<
Sample = "stores.csv",
Separators = ";",
Encoding = "ISO8859-1",
public class SelfHostRootPathProvider : IRootPathProvider
{
public string GetRootPath()
{
if (StaticConfiguration.IsRunningDebug)
{
return string.Empty; // TODO: Return source directory
}
return AppDomain.CurrentDomain.BaseDirectory;
@khellang
khellang / project.json
Created September 16, 2014 12:06
Which would you rather write? Or read?
{
"code": "*.cs",
"exclude": "buggy/**/*.cs",
"resources": "embed/**/*.*",
"dependencies": {
"Microsoft.AspNet.ConfigurationModel": { "version": "0.1-alpha-*", "options": "private" },
"FakeToolingPackage" : {"version": "0.1", "options": "dev"},
"SomeProject": ""
},
"configurations": {
public class Movie
{
[CompilerGenerated]
private readonly string <Title>k__BackingField;
[CompilerGenerated]
private readonly List<string> <Genres>k__BackingField;
public string Title
{
/// <summary>
/// This function tries to normalize a string that represents framework version names into
/// something a framework name that the package manager understands.
/// </summary>
public static FrameworkName ParseFrameworkName(string frameworkName)
{
if (frameworkName == null)
{
throw new ArgumentNullException("frameworkName");
}
var utested = {
'harveys': {
name: 'Harveys',
address: 'Tollbodata 3, 4611 Kristiansand',
latitude: 58.1441782,
longitude: 7.993443899999988,
website: 'http://www.harveys.no/news/hjem.html',
openingHours: [
{ days: 'Mandag - Onsdag', open: '1500', close: '2200' },
{ days: 'Torsdag - Fredag', open: '1500', close: '0200' },
let buildMode = getBuildParamOrDefault "buildMode" "Release"
let testResultsDir = "./testresults"
let appBuildDir = "./src/**/bin" @@ buildMode
let testBuildDir = "./test/**/bin" @@ buildMode
Target "Clean" (fun _ ->
!! appBuildDir
++ testBuildDir
++ testResultsDir
<todo>
<!-- layout -->
<h3>{ opts.title }</h3>
<ul>
<li each={ item, i in items }>{ item }</li>
</ul>
<form onsubmit={ add }>