Skip to content

Instantly share code, notes, and snippets.

View krisajenkins's full-sized avatar
💭
:: Geek

Kris Jenkins krisajenkins

💭
:: Geek
View GitHub Profile
@krisajenkins
krisajenkins / Demo.elm
Last active May 24, 2016 10:37
elm-html runtime bug
module Main exposing (..)
import Html exposing (..)
import Html.App exposing (beginnerProgram)
import Html.Events exposing (onClick, on, targetChecked)
type View
= Ascending
| Descending
@krisajenkins
krisajenkins / Demo.elm
Created May 26, 2016 11:40
Virtual dom bug test case.
module Main exposing (..)
import Html exposing (..)
import Html.App exposing (beginnerProgram)
import Html.Events exposing (onClick, on, targetChecked)
type View
= Ascending
| Descending
@krisajenkins
krisajenkins / elm-make-bug.sh
Created July 10, 2016 13:42
Demostrates a dependency-checking bug in elm-make.
#!/bin/sh
############################################################
# Create a simple working program.
############################################################
cat <<EOF > Foo.elm
module Foo exposing (..)
type alias Foo = Int
EOF
@krisajenkins
krisajenkins / CodeMesh2016.org
Created November 7, 2016 18:05
My notes from CodeMesh 2016

CodeMesh 2016 <2016-11-03 Thu>

Space Monads

We move the effort into designing the type, so that writing the algorithm is simpler.

[#B] Look at Hoare Logic

There is a relationship between monads and Hoare Logic. Can I solve the 9-jigsaw puzzle with Monads? https://en.wikipedia.org/wiki/Hoare_logic

Look at applications of Kleisli monads.

@krisajenkins
krisajenkins / Playground.hs
Created January 28, 2019 10:53
Plutus Playground Smart Contract
-- | Vesting scheme as a PLC contract
module Vesting where
import Control.Monad (void)
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Interval as Interval
import qualified Language.PlutusTx.Prelude as P
import Ledger
import Ledger.Validation
@krisajenkins
krisajenkins / Playground.hs
Created January 28, 2019 17:10
Plutus Playground Smart Contract
-- | Crowdfunding contract implemented using the [[Plutus]] interface.
-- This is the fully parallel version that collects all contributions
-- in a single transaction.
--
-- Note [Transactions in the crowdfunding campaign] explains the structure of
-- this contract on the blockchain.
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Interval as Interval
import Ledger.Interval (SlotRange)
import qualified Language.PlutusTx.Prelude as P
@krisajenkins
krisajenkins / Playground.hs
Last active January 28, 2019 17:14
Plutus Playground Smart Contract
-- | Crowdfunding contract implemented using the [[Plutus]] interface.
-- This is the fully parallel version that collects all contributions
-- in a single transaction.
--
-- Note [Transactions in the crowdfunding campaign] explains the structure of
-- this contract on the blockchain.
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Interval as Interval
import Ledger.Interval (SlotRange)
import qualified Language.PlutusTx.Prelude as P
@krisajenkins
krisajenkins / Playground.hs
Created January 28, 2019 17:14
Plutus Playground Smart Contract
-- | Crowdfunding contract implemented using the [[Plutus]] interface.
-- This is the fully parallel version that collects all contributions
-- in a single transaction.
--
-- Note [Transactions in the crowdfunding campaign] explains the structure of
-- this contract on the blockchain.
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Interval as Interval
import Ledger.Interval (SlotRange)
import qualified Language.PlutusTx.Prelude as P
@krisajenkins
krisajenkins / Playground.hs
Created January 28, 2019 17:15
Plutus Playground Smart Contract
-- | Crowdfunding contract implemented using the [[Plutus]] interface.
-- This is the fully parallel version that collects all contributions
-- in a single transaction.
--
-- Note [Transactions in the crowdfunding campaign] explains the structure of
-- this contract on the blockchain.
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Interval as Interval
import Ledger.Interval (SlotRange)
import qualified Language.PlutusTx.Prelude as P
@krisajenkins
krisajenkins / Playground.hs
Created January 28, 2019 17:16
Plutus Playground Smart Contract
-- | Crowdfunding contract implemented using the [[Plutus]] interface.
-- This is the fully parallel version that collects all contributions
-- in a single transaction.
--
-- Note [Transactions in the crowdfunding campaign] explains the structure of
-- this contract on the blockchain.
import qualified Language.PlutusTx as PlutusTx
import qualified Ledger.Interval as Interval
import Ledger.Interval (SlotRange)
import qualified Language.PlutusTx.Prelude as P