Skip to content

Instantly share code, notes, and snippets.

@mightybyte
mightybyte / pact-web-share.pact
Created March 19, 2019 19:05
Pact shared with pact-web.
;;
;; A little example showing off the merits of formal
;; verification and why it pays off.
;;
;;---------------------------------
;;
;; Create an 'admin-keyset' and add some key, for loading this contract!
;;
;; Make sure the message is signed with this added key as well.
@mightybyte
mightybyte / pact-web-share.pact
Created March 15, 2019 19:20
Pact shared with pact-web.
;; This is a test of the gist saving mechanism
;; accounts module, admin keyset, and table
; (load "examples/verified-accounts/accounts.repl")
(enforce-pact-version "2.4.1")
(define-keyset 'accounts-admin-keyset
(read-keyset "accounts-admin-keyset"))
@mightybyte
mightybyte / pact-web-share.pact
Last active March 15, 2019 19:17
Pact shared with pact-web.
;;---------------------------------
;; Doug demo testZZZ
;; Create a keyset named 'keyset' and add some key,
;; for loading this contract!
;;
;; Make sure the message is signed with this added key as well.
;;---------------------------------
(define-keyset 'module-keyset (read-keyset "keyset"))
@mightybyte
mightybyte / pact-web-share.pact
Created March 15, 2019 19:05
Pact shared with pact-web.
;;
;; Hi Doug, please find your favorite smart contract below.
;;
;; Best,
;; Robert
(define-keyset 'admin-keyset (read-keyset "admin-keyset"))
;; Define the module.
(module verificationDoug 'admin-keyset
@mightybyte
mightybyte / haskell-language-extensions.md
Last active August 31, 2023 07:50
A Taxonomy of Haskell Language Extensions

Haskell Language Extension Taxonomy

Caveat: It's just personal opinion, and was written to be a bit provocative and encourage discussion . It is also something that is constantly evolving. Some of the main criteria I used in constructing this taxonomy are age, how widely used it us, and how well understood it is by the average Haskell programmer. These things will change over time.

Aso, this is focused on appropriateness for use in commercial production code bases. If you are not thinking about commercial use with a team of multiple

@mightybyte
mightybyte / gist:33fed8318386983cd1b6064edba67034
Created December 5, 2017 04:27
zsh completion debug file
+_complete_debug:20> : zsh 5.0.8
+_complete_debug:21> _main_complete
+_main_complete:11> local 'IFS=
'
+_main_complete:25> eval 'local -A _comp_caller_options;
_comp_caller_options=(${(kv)options[@]});
setopt localoptions localtraps localpatterns ${_comp_options[@]};
local IFS=$'\'' \t\r\n\0'\''
enable -p \| \~ \( \? \* \[ \< \^ \#
exec </dev/null;
{-# LANGUAGE DeriveFunctor #-}
module Form where
import Control.Lens
import Data.Default
import Data.Functor.Compose
import Data.Monoid
import Reflex
@mightybyte
mightybyte / FileLoader.hs
Created January 2, 2017 04:46
Reflex file loader
fileLoader :: MonadWidget t m => FileInputConfig t -> m (Event t Text)
fileLoader cfg = do
fls <- fmapMaybe listToMaybe . updated . value <$> fileInput cfg
reader <- liftIO newFileReader
performEvent_ $ ffor fls $ \f -> liftIO $
readAsDataURL reader (Just f)
wrapDomEvent reader (`on` load) $ do
res <- liftIO $ fromJSValUnchecked =<< getResult reader
let Right contents = decodeUtf8 <$> B64.decode
(encodeUtf8 $ snd $ T.breakOnEnd "base64," res)
@mightybyte
mightybyte / download-pages.md
Last active August 30, 2016 15:30
Programming Language Download Pages
$ cabal sandbox add-source ../cabal/Cabal
$ cabal install
Warning: the --global flag is deprecated -- it is generally considered a bad
idea to install packages into the global store
Resolving dependencies...
Notice: installing into a sandbox located at
/Users/mightybyte/haskell/packunused-0.1.1.4/.cabal-sandbox
Configuring ansi-terminal-0.6.2.3...
Configuring old-locale-1.0.0.7...
Configuring split-0.2.3.1...