Skip to content

Instantly share code, notes, and snippets.

Julian Leviston JulianLeviston

Block or report user

Report or block JulianLeviston

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JulianLeviston
JulianLeviston / README.md
Created Sep 17, 2019 — forked from williamhaley/README.md
Ember Twiddle Demo: Simple nested routes
View README.md

Ember Twiddle Demo: Simple nested routes

Demo

Basic example of nested routes with some CSS to highlight the active route in the navigation links.

View Dijkstra.hs
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)
View Alarms.elm
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.
@JulianLeviston
JulianLeviston / Doors.elm
Created Nov 24, 2018
Some code that illustrates a nice pattern of dependant update functions to allow flexible reuse and separation of concerns
View Doors.elm
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.
View response.json
{
"student_progress": [
{
"show_placement_test": false,
"id": "learning",
"complete_rows": [
2,
3,
4,
5,
@JulianLeviston
JulianLeviston / sigils.txt
Created Jun 8, 2017
Sigil Cheatsheet for Elixir 1.4
View sigils.txt
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
@JulianLeviston
JulianLeviston / Test.hs
Created Jun 4, 2017
Showing output from arbitrary grammar with some expressions
View Test.hs
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
@JulianLeviston
JulianLeviston / simple_todo.ex
Created Dec 1, 2016
TodoList implementation
View simple_todo.ex
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
You can’t perform that action at this time.