Tagged

Coding

A collection of 15 posts

Coding

Installing Jekyll on Fedora (33) - With User Only Gems

sudo dnf install ruby ruby-devel rubygems-devel \ autoconf automake bison gcc-c++ libffi-devel libtool \ libyaml-devel readline-devel sqlite-devel zlib-devel \ openssl-devel redhat-rpm-config rubygem-nokogiri gem install rubygems-update gem install jekyll bundler bundle install --path ~/.gem/ruby/gems/ Basically nicked from here but modified to not install gems as root (which I find unnecessary personally) After

Coding

Haskell: Find and Replace in File

module MyLib ( findReplaceAndCopyFile, findReplaceInFile, replaceMarkerWithFile, replaceMarkerWithFile2, replaceMarkerWithFile3 ) where import Data.List (intercalate) import Data.List.Split (splitOn) import System.IO (stdout, hFlush, hPutStr) import Type.Reflection (typeOf) import System.Directory replaceMarkerWithFile_ :: FilePath -> FilePath -> String -> FilePath -> IO () replaceMarkerWithFile_ inFile outFile marker injectionFile = do inFileText FilePath -> String

Coding

Haskell Hakyll: site.hs

-------------------------------------------------------------------------------- {-# LANGUAGE OverloadedStrings #-} import Data.Monoid (mappend) import Hakyll import Hakyll.Web.Paginate import qualified Data.Map as M import Control.Monad (liftM) -------------------------------------------------------------------------------- main :: IO () main = hakyll $ do match "images/*" $ do route idRoute compile copyFileCompiler match "css/*" $ do route idRoute compile compressCssCompiler match (fromList ["about.rst", "contact.