Continuation of Encoding Overlapping, Extensible Isomorphisms: encoding "open kinds" to better express some awkward type classes.
#!/usr/bin/env bash | |
set -euo pipefail | |
# Always use the by-id aliases for devices, otherwise ZFS can choke on imports. | |
DISK=${DISK:-/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_500GB_S4EVNF0M531397T} | |
EFI=${EFI:-true} | |
function Usage() { | |
echo "usage: $0 install|revert" >&2 |
let cache = new Map(); | |
let pending = new Map(); | |
function fetchTextSync(url) { | |
if (cache.has(url)) { | |
return cache.get(url); | |
} | |
if (pending.has(url)) { | |
throw pending.get(url); | |
} |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import Control.Applicative | |
import Data.Char | |
import Data.List (intersperse) | |
import Data.Monoid hiding (All, Any) | |
import Data.Foldable hiding (all, any) | |
import Prelude hiding (all, any) |
{-# LANGUAGE DataKinds, TypeFamilies, TypeOperators, GADTs, | |
ScopedTypeVariables, TypeOperators #-} | |
-- | Type-level natural numbers and singletons, with proofs of | |
-- a few basic properties. | |
module BasicNat ( | |
-- | Type-level natural numbers | |
Nat (..) | |
, type (+) |
{-# LANGUAGE TemplateHaskell #-} | |
-- | For when you have a record that doesn't have lenses derived for | |
-- it and you need a lens, just use @$(lens 'thefield)@ and away you go. | |
module Control.Lens.FieldTH where | |
import Language.Haskell.TH | |
lens :: Name -> Q Exp | |
lens name = do | |
[|\f r -> | |
fmap | |
$(lamE |
All actions should be performed in the root directory of a Haskell project that uses stack.
The following lines should be present in the project's stack.yaml
file:
docker:
enable: true
Additionally, the BaseImage
and Dockerfile
files from this gist should also be present in the
project's root directory.
So, with credit to the Factorio wiki and cbednarski's helpful gist, I managed to eventually setup a Factorio headless server. Although, I thought the process could be nailed down/simplified to be a bit more 'tutorialised' and also to document how I got it all working for my future records.
The specific distro/version I'm using for this guide being Ubuntu Server 16.04.1 LTS
. Although, that shouldn't matter, as long as your distro supports systemd
(just for this guide, not a Factorio headless requirement, although most distros use it as standard now).
The version of Factorio I shall be using is 0.14.20
, although should work for any version of Factorio 0.14.12
and higher.
Just a note to newcomers: If there are any issues with the installation steps, people in the comments are doing a good job
Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.
My 3 developers team has just developed React.js application with 7668
lines of CSS (and just 2 !important
).
During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.
Here are main principles we use to write CSS for modern (IE11+) browsers:
- SUIT CSS naming conventions + SUIT CSS design principles;
- PostCSS + CSSNext. Future CSS syntax like variables, nesting, and autoprefixer are good enough;
- Flexbox is awesome. No need for grid framework;
- Normalize.css, base styles and variables are solid foundation for all components;
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{- | |
Explores Free Monads (DSLs) and Cofree Comonads (interpreters) and | |
their relationship. | |
Most of the code in this file comes from (1) below. Only minor | |
modifications are made - semantics are preserved. |