Skip to content

Instantly share code, notes, and snippets.

View RalfNorthman's full-sized avatar

Ralf Northman RalfNorthman

  • Stockholm, Sweden
View GitHub Profile
@RalfNorthman
RalfNorthman / gist:4204ed3afda04d2ead43ba3330e7b786
Last active September 29, 2019 17:01
Installing Elm on Antergos (ArchLinux)
sudo pacman -S npm
sudo npm install --unsafe-perm -g elm elm-test elm-oracle elm-format
sudo ln -s /usr/lib/libtinfo.so /usr/lib/libtinfo.so.5
# Add this to your .vimrc if you use Vim with Vundle:
Plugin 'ElmCast/elm-vim'
@RalfNorthman
RalfNorthman / phantom_ids.rs
Last active February 16, 2022 19:17
Fun with the usage crate
use usage::Usage;
struct Author;
struct CanonicalAuthor;
struct Title;
type AuthorId = Usage<Author, i32>;
type CanonicalAuthorId = Usage<CanonicalAuthor, i32>;
type TitleId = Usage<Title, i32>;
@RalfNorthman
RalfNorthman / swe_locale.md
Created October 9, 2022 13:40
litvis elm-vegalite swedish locale

Svensk lokalisering i vega-lite för tidsformat etc

cfg : List LabelledSpec -> ( VLProperty, Spec )
cfg =
    configure
        << configuration
            (coLocale
                [ loDecimal ","
 , loGrouping 3
@RalfNorthman
RalfNorthman / spec.json
Created October 10, 2022 07:13
Time axis fancy format
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"width": 700,
"data": {
"sequence": {
"start": -11000000,
"stop": 10000000,
"step": 100000,
"as": "time"
}