Skip to content

Instantly share code, notes, and snippets.

@smurphy8
smurphy8 / eventLoopProgram.c
Last active April 7, 2017 02:57
Layout of an event loop
const int sensor =0;
const int power = 1;
const int relay = 2;
const int bigDelay = 6250; //ms
const int smallDelay = 100; //ms
const int loopDelay = 1000; //ms
import qualified System.Random as R
import Control.Monad (replicateM)
data Multiplier = FourTimes | TwoTimes
deriving (Eq,Show)
generateMultipliers :: IO [Multiplier]
data Foo = Foo { firstItem :: Int
, secondItem :: Float}
processFoos incomingFoos = do
let foos = fmap firstItem incomingFoost
return $ toJSON $ foos
@smurphy8
smurphy8 / business-canvas-template.html
Created September 8, 2016 22:36
Business and Risk Canvas
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Business Canvas Template</title>
<!-- Bootstrap -->
#!/usr/bin/env stack
{- stack
--resolver
lts-6.4
--install-ghc
runghc --package turtle
-}
cabal install --only-dependencies --enable-prof --enable-library-profiling
  1. Don't use partial functions (head, read, tail, fromJust, fail (in IO), error, undefined ... )
  2. Functions are your friend, use lots of them and keep them small.
  3. Serialization errors are the most common error in our codebase. When you are creating a JSON, Binary or Serialize instance try and avoid the standard "generator" functions.
constraints: Crypto ==4.2.5.1,
HTTP ==4000.2.19,
HUnit ==1.2.5.2,
MissingH ==1.3.0.1,
MonadRandom ==0.4,
QuickCheck ==2.8.1,
ReadArgs ==1.2.2,
StateVar ==1.1.0.0,
adjunctions ==4.2.1,
aeson ==0.8.0.2,
@smurphy8
smurphy8 / DisneyRides.org
Created June 19, 2015 12:16
Disney world rides and friendliness for Ellie

Walt Disney World Trip Notes

Magic Kingdom

Ellie Friendly

Astro Orbiter

Country Bear Jamboree

Dumbo the flying Elephant

Enchanted Tales With Belle

Hall of Presidents

@smurphy8
smurphy8 / invoice.hs
Last active August 29, 2015 14:22
Invoice Template For QuickBooks
{--|
# Invoice and Spreadsheet template system for Kiosk
# The system should:
##* Allow a template to be specified that has holes which can be filled
in from a [TemplateTableStore + DataTemplateEntry]
## Primary goals