Basic example of nested routes with some CSS to highlight the active route in the navigation links.
This file contains hidden or 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
import Controller from '@ember/controller'; | |
import { computed } from '@ember/object'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
firstName = 'Abe'; | |
lastName = 'Simpson'; | |
@computed('firstName', 'lastName') | |
get fullName() { |
This file contains hidden or 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
module Dijkstra where | |
import qualified Data.Graph.Inductive.Graph as G | |
import Data.Graph.Inductive.Graph (mkGraph, labNodes, LEdge) | |
import Data.Graph.Inductive.PatriciaTree (Gr) | |
import qualified Data.Array as Ar | |
import qualified Data.Map as M | |
import qualified Data.Set as S | |
import qualified Control.Monad.State as St | |
import Control.Monad.State (State, runState) |
This file contains hidden or 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
module Alarm exposing (main) | |
import Browser | |
import Html exposing (Html, button, div, h2, text) | |
import Html.Events exposing (onClick) | |
{-| This is an attempt at building up a dependency between pieces of state | |
that can be separate and then allowing us to compose them naturally. |
This file contains hidden or 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
module Doors exposing (main) | |
import Browser | |
import Html exposing (Html, button, div, h2, text) | |
import Html.Events exposing (onClick) | |
{-| This is an attempt at building up a dependency between pieces of state | |
that can be separate and then allowing us to compose them naturally. |
This file contains hidden or 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
{ | |
"student_progress": [ | |
{ | |
"show_placement_test": false, | |
"id": "learning", | |
"complete_rows": [ | |
2, | |
3, | |
4, | |
5, |
This file contains hidden or 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
sigil_C/2 sigil_D/2 sigil_N/2 sigil_R/2 sigil_S/2 sigil_T/2 | |
sigil_W/2 sigil_c/2 sigil_r/2 sigil_s/2 sigil_w/2 | |
~C is a list of characters, no escaping or interpolation | |
~c is a list of characters, escaped and interpolated just like a single quoted string | |
~R is a regular expression with no escaping or interpolation | |
~r is a regular expression, escaped and interpolated | |
~S is a string with no escaping or interpolation | |
~s is a string, escaped and interpolated same as a double quoted string | |
~W is whitespace-delimited words as a list. No escaping or interpolation |
This file contains hidden or 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
module Test where | |
data EExp a | |
= ELit a | |
| EAdd (EExp a) (EExp a) | |
eg1 :: EExp Int | |
eg1 = EAdd (ELit 1) (EAdd (ELit 2) (ELit 0)) | |
eg2 :: EExp Int |
This file contains hidden or 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
defmodule TodoServer do | |
def start do | |
spawn(fn -> loop(TodoList.new) end) | |
end | |
def add_entry(todo_server, new_entry) do | |
send(todo_server, {:add_entry, new_entry}) | |
end | |
def entries(todo_server, date) do |