Skip to content

Instantly share code, notes, and snippets.

Verifying my Blockstack ID is secured with the address 12VTLbXw8Kp8maxDVsdsvjbMwSumrTWSWy https://explorer.blockstack.org/address/12VTLbXw8Kp8maxDVsdsvjbMwSumrTWSWy
Verifying that "justindthomas.id" is my Blockstack ID. https://onename.com/justindthomas
mkPersist defaultCodegenConfig [groundhog|
definitions:
- entity: Article
dbName: article
fields:
- name: created_at
dbname: created_at
default: now()
|]
https://github.com/snapframework/xmlhtml/blob/master/src/Text/XmlHtml/HTML/Render.hs#L89
https://github.com/snapframework/xmlhtml/blob/master/src/Text/XmlHtml/XML/Render.hs#L134
https://github.com/snapframework/xmlhtml/blob/master/src/Text/XmlHtml/XML/Render.hs#L114
^^^ this is is the line that I tweaked to get rid of them in XML files
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module Main where
main :: IO ()
main = do
putStrLn "Starting Server..."
S.scotty 3000 $ do
S.get "/" $ S.html "Hello World!"
S.get "/articles" $ do
articles <- inHandlerDb $ selectList [] []
S.html ("Articles!" <> (T.pack $ show $ length (articles :: [Entity Article])))
S.get "/articles/:id" $ do
data Article = Article
{ articleId :: Int
, title :: T.Text
, content :: T.Text
, created_at :: LocalTime
}
splice :: (HasPostgres n, Monad n) => C.Splice n
splice = do
Couldn't match expected type ‘Article -> T.Text’
with actual type ‘T.Text’
In the second argument of ‘(##)’, namely
‘T.pack
$ L.unpack $ X.renderHtml $ markdownToHtml $ T.pack $ show content’
In a stmt of a 'do' block:
"articleContent"
##
T.pack
$ L.unpack $ X.renderHtml $ markdownToHtml $ T.pack $ show content
## Prepare VyOS image
VYOS_URL="http://mirror.tuxhelp.org/vyos/iso/release/1.1.7/vyos-1.1.7-i586-virt.iso"
if [ ! -f $ROOT_DIR/tmp/vyos.iso.dist ]; then
echo "Preparing base VyOS image..."
wget $VYOS_URL -O $ROOT_DIR/tmp/vyos.iso.dist
mkdir -p $ROOT_DIR/tmp/mnt
sudo mount -o loop -t iso9660 $ROOT_DIR/tmp/vyos.iso.dist $ROOT_DIR/tmp/mnt
mkdir -p $ROOT_DIR/tmp/vyos-orig
cp -r $ROOT_DIR/tmp/mnt/* $ROOT_DIR/tmp/vyos-orig/
sudo strace -p 16521
Process 16521 attached
restart_syscall(<... resuming interrupted call ...>) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0
nanosleep({0, 200000000}, NULL) = 0