Skip to content

Instantly share code, notes, and snippets.

View mdgriffith's full-sized avatar

Matthew Griffith mdgriffith

View GitHub Profile
module Main exposing (..)
import Style
------------ Style initialization ---------------
{-| Normal init
git submodule add git@mygithost:billboard lib/billboard
git submodule add https://github.com/mdgriffith/ui-animation lib
git submodule update --remote --merge
module Main exposing (..)
import Html.App as Html
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (..)
import Animation exposing (px)
import Animation.Messenger
docker-machine create --driver virtualbox my-docker-machine
# focus on new machine
eval $(docker-machine env my-docker-machine)
# Run docker and drop into a bash session
docker run -it my-docker-image /bin/bash
import Style exposing (..)
import Style.Elements exposing (..)
baseText : Style.Text
baseText =
{ font = "georgia"
, size = 16
, characterOffset = Nothing
// LDA Model
{
"kind": "lda",
"signature": "H9fdnifsd89" // A unique identifier for a given lda model. Could be a hash of num topics ++ input data
"tokenCache": ["word","in","cache"] // A token id is its index in the list. This might make more sense as a record.
"topics": { 1 : {1:431,2:32} // a where key == token id, and value == word count. Though it might make sense to normalize them before storing the lda.
, 2 : {1:32,2:0}
, "emailBackgroundNoise" : {1:32,2:0}
, "twitterBackgroundNoise" : {1:32,2:0}

Invalid CSS States and Conundrums

First off, disclaimer: this is an experiment :) I present some of these ideas in an opinionated way, but I realize there may be a lot of cases I'm not accounting for and probably a good number. Also who knows if this approach ultimately makes sense! Huray experimentation!

I believe there are a few reasons that css is irritating.

  1. Able to write invalid styles - There are a lot of invalid styles you can write. Some properties will break other properties.
  2. Secret Defaults
  3. Most everything is obtusely named :/
# This is a dictionary for the file-type information when
# building the manifest entries in the OPF.
entry_dict = ({"xhtml": 'application/xhtml+xml',
"html": 'application/xhtml+xml',
"css": 'text/css',
"png": 'image/png',
"jpg": 'image/jpeg',
"jpeg": 'image/jpeg',
"tiff": 'image/tiff',
"gif": 'image/gif',
-- Create a helper function that organizes your animations
-- You might consider listing the literal animations here.
-- Meaning embed "Animation.interrupt..." instead of referring it to the value closeMenuStyle.
-- This is probably the only place those animation definitions are going to live and
-- it's nice to have one place to go to understand whats going on.
runAnimation menu model =
case menu of
UserMenu Open ->
-- A Color Palette is a record that tracks
-- border, text and background color
primary =
Style.Color.palette
{ border = Color.blue
, text = Color.red
, background = Color.white
}