Skip to content

Instantly share code, notes, and snippets.

View philderbeast's full-sized avatar

Phil de Joux philderbeast

View GitHub Profile
@philderbeast
philderbeast / README.md
Created May 8, 2018 10:56 — forked from dwhitney/README.md
Quick React Native with PureScript
  1. create-react-native-app purescript-app; cd purescript-app

  2. pulp init --force

  3. pulp build

  4. src/Main.js

var React = require("react");
var RN = require("react-native");

exports.text = function(props){
@philderbeast
philderbeast / sudoku-loeb.hs
Created June 9, 2017 16:04
Solve Sudoku using the magical Loeb function.
import Data.List
-- This code solves Sudoku puzzles using a magical function called Loeb.
--
-- Loeb allows you to define a list of functions which resolves into a list
-- of values, allowing the list to self-reference. In the case of Sudoku, the
-- solver code will terminate only in the case where the Sudoku puzzle has
-- a unique solution.
--
-- The code starts with a 1-dimensional list (representing the 2-dimensional
open System
open System.Collections.Generic
type IMonoid<'T> =
abstract member mempty : unit -> 'T
abstract member mappend : 'T * 'T -> 'T
type MonoidAssociations private() =
static let associations = new Dictionary<Type, obj>()
static member Add<'T>(monoid : IMonoid<'T>) = associations.Add(typeof<'T>, monoid)
@philderbeast
philderbeast / Capture.fs
Last active December 15, 2015 11:28 — forked from lobrien/gist:5250556
namespace VideoCaptureInFSharp
open System
open System.Drawing
open System.IO
open MonoTouch.Foundation
open MonoTouch.UIKit
open MonoTouch.AVFoundation
open MonoTouch.CoreMedia
open MonoTouch.CoreGraphics