Skip to content

Instantly share code, notes, and snippets.

@zackrw
zackrw / Gemfile
Created September 27, 2012 16:16
Yale CAS and user info with Rails (after security "upgrade" on LDAP)
#
## Add the rubycas-client gem to your Gemfile and run bundle install
#
gem 'rubycas-client'
gem 'mechanize'
0x988c4e1155904EF625e3Dc0Ce36006E1a3C1AEC6
@zackrw
zackrw / Playground.hs
Created January 30, 2021 00:44
Plutus Playground Smart Contract
import qualified Data.Text as T
import Language.Plutus.Contract hiding (when)
import Language.PlutusTx.Prelude
import Playground.Contract
aussie :: String -> String
aussie s = tail s
-- | A 'Contract' that logs a message.
hello :: Contract BlockchainActions T.Text ()
@zackrw
zackrw / Playground.hs
Created January 30, 2021 01:41
Plutus Playground Smart Contract
-- A game with two players. Player 1 thinks of a secret word
-- and uses its hash, and the game validator script, to lock
-- some funds (the prize) in a pay-to-script transaction output.
-- Player 2 guesses the word by attempting to spend the transaction
-- output. If the guess is correct, the validator script releases the funds.
-- If it isn't, the funds stay locked.
import Control.Monad (void)
import qualified Data.ByteString.Char8 as C
import Language.Plutus.Contract
import qualified Language.PlutusTx as PlutusTx
@zackrw
zackrw / Main.hs
Last active January 30, 2021 02:19
buyreleaserefund
{-# LANGUAGE OverloadedStrings #-}
module ZeroCouponBond where
import Language.Marlowe
main :: IO ()
main = print . pretty $ contract
contract :: Contract
contract = When [ Case