Skip to content

Instantly share code, notes, and snippets.

Stachu Korick StachuDotNet

View GitHub Profile
View gist:dd2fe487ff3a482a2ee2
var da = new DataSet();
var adapter = new OleDbDataAdapter();
var path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
path += "asdf_5.xlsx";
var connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path
+ @";Extended Properties=""Excel 12.0 Macro;HDR=YES;ImportMixedTypes=Text;TypeGuessRow=0""";
var conn = new OleDbConnection(connectionString);
View gist:d2eb8143cb167e7d36f8
module CubeSolver
// Represent the state of a Rubik's Cube
type CubeState =
{ EdgePositions : int array
EdgeFlips : int array
CornerPositions : int array
CornerTwists : int array }
@StachuDotNet
StachuDotNet / gist:b291a049df0f3761f4bc
Last active Aug 29, 2015
Wanted to make sure I can consistently do my 5x5 workout in under an hour. Of course F# is needed for the task!
View gist:b291a049df0f3761f4bc
type event = { text : string; minutes: double }
type exercise = {
text : string
setNum : int
setupTime : double
setTime : double
restTime : double
}
View gist:bb0b2f6aed9013f73052
public abstract class PersistentConnection
{
public virtual void Initialize(IDependencyResolver resolver);
public bool Authorize(IRequest request);
protected virtual TraceSource Trace { get; } }
protected IProtectedData ProtectedData { get; private set; }
View rps.fs
open System
type Choice = Rock | Scissors | Paper
type RoundResult = WinRound | TieRound | LoseRound
let roundResult = function
| Rock, Rock | Scissors, Scissors | Paper, Paper -> TieRound
| Rock, Scissors | Scissors, Paper | Paper, Rock -> WinRound
| Rock, Paper | Scissors, Rock | Paper, Scissors -> LoseRound
View sobokan.fs
open System
let exampleLevel = [
" #####"
" # #"
" #$ #"
" ### $##"
" # $ $ #"
"### # ## # ######"
"# # ## ##### ..#"
@StachuDotNet
StachuDotNet / Sokoban.fs
Created Nov 6, 2015 — forked from hakelimopu/Sokoban.fs
A sokoban player in F# (.NET, console-based)
View Sokoban.fs
open System
let exampleLevel = [
" #####";
" # #";
" #$ #";
" ### $##";
" # $ $ #";
"### # ## # ######";
"# # ## ##### ..#";
View gist:83aeee393d54e1ca837d2fa95b2d6d11
/*
Add these:
using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
*/
void Main()
{
WriteDeltas(new Foo { X = 123, Y = DateTime.Today, Z = null },
@StachuDotNet
StachuDotNet / fable-repl.css
Created Apr 11, 2019
Created with Fable REPL
View fable-repl.css
html,
body {
font-size: 16px;
}
.main-container {
display: flex;
width: 100%;
height: 100%;
justify-content: center;
@StachuDotNet
StachuDotNet / fable-repl.css
Created Apr 11, 2019
Created with Fable REPL
View fable-repl.css
html,
body {
font-size: 16px;
}
.main-container {
display: flex;
width: 100%;
height: 100%;
justify-content: center;
You can’t perform that action at this time.