This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 12VTLbXw8Kp8maxDVsdsvjbMwSumrTWSWy https://explorer.blockstack.org/address/12VTLbXw8Kp8maxDVsdsvjbMwSumrTWSWy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that "justindthomas.id" is my Blockstack ID. https://onename.com/justindthomas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkPersist defaultCodegenConfig [groundhog| | |
definitions: | |
- entity: Article | |
dbName: article | |
fields: | |
- name: created_at | |
dbname: created_at | |
default: now() | |
|] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
module Main where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Article = Article | |
{ articleId :: Int | |
, title :: T.Text | |
, content :: T.Text | |
, created_at :: LocalTime | |
} | |
splice :: (HasPostgres n, Monad n) => C.Splice n | |
splice = do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder