Skip to content

Instantly share code, notes, and snippets.

View frpaulas's full-sized avatar

Paul Sutcliffe frpaulas

View GitHub Profile
pry(4)> conn |> put_layout("app.html") |> render("mp.html", model: model, page_controller: "prayer")
** (FunctionClauseError) no function clause matching in Phoenix.HTML.raw/1
The following arguments were given to Phoenix.HTML.raw/1:
# 1
{:ok,
"<div><div id='Psalm_102' class='req'> <h3>Psalm 102. <span class=\"ps_title\">Domine, exaudi.</span> </h3> </br> <ul class=\"psalm\"> <li class=\"ps_num\"><sup>1</sup></li> <li class=\"ps_first\">HEAR my prayer, O LORD, &#42; </li> </ul> <ul class=\"psalm\"> <li class=\"ps_second\">and let my crying come unto thee.</li> </ul> <ul class=\"psalm\"> <li class=\"ps_num\"><sup>2</sup></li> <li class=\"ps_first\">Hide not thy face from me in the time of my trouble; &#42; </li> </ul> <ul class=\"psalm\"> <li class=\"ps_second\">incline thine ear unto me when I call; O hear me, and that right soon.</li> </ul> <
# welp nearly grammar
@{%
const moo = require("moo");
// FYI \u201C - left curly quote; \u201D - right curly quote
const lexer = moo.compile({
ws: {match: /[ \t\n\r]+/, lineBreaks: true},
number: /[0-9]+/,
letters: /[a-zA-Z]+/,
times: /\*|x/,
// Family Prayer
// Concerning the Service
// These devotions follow the basic structure of the Daily Office of the Church and are
// particularly appropriate for families with young children.
// The Reading and the Collect may be read by one person, and the other parts said in unison,
// or in some other convenient manner.
// Appropriate Opening Sentences, Psalms, Readings, and Collects are provided in each
// service. When desired, however, the Collect of the Day, or any of the Collects appointed in
// the Daily Offices, may be used instead. The Opening Sentences may be replaced by those
// appointed for various seasons in the liturgies for Morning and Evening Prayer.
var firstReading = Observable()
// mp1 has two Objects of
// {title: title, chap: chap, vsFrom: vsFrom, vsTo: vsTo, vss: vss}
mp1.forEach(function(el) {
var obj = getReading(el.read);
obj.type = el.style;
firstReading.add(obj);
})
@frpaulas
frpaulas / calendar view
Created June 27, 2016 21:59
Second modal cause repeated reloads with iOS 9+ safari
<div id= "header-elm-container"></div>
<div>
<table id= "calendar">
<tr>
<th class= "mpep_link" colspan= "3"><a href= "morningPrayer"><button>Morning Prayer</button></a></th>
<th class= "mpep_link">Today</th>
<th class= "mpep_link" colspan= "3"><a href= "eveningPrayer"><button>Evening Prayer</button></a></th>
</tr>
<tr>
<th class= "season_link" colspan= "2">
@frpaulas
frpaulas / versionSelect.elm
Last active June 24, 2016 09:13
select option
type Msg
= NoOp
| Checked Key String
| ChangeVersion String
| ChangeFootnote Bool
update: Msg -> Model -> Model
update msg model =
case msg of
NoOp -> model
Building release with MIX_ENV=prod.
==> Generating relx configuration...
==> Generating sys.config...
==> Generating boot script...
==> Packaging consolidated protocols...
==> Generating release...
===> Starting relx build process ...
===> state(api):
log: (3:debug),
config file: /Users/paulsutcliffe/Documents/I/iphod/rel/files/relx.config
athomeanglican:iphod paulsutcliffe$ iex -S mix
Erlang/OTP 18 [erts-7.2] [source-e6dd627] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
mix.exs:12: warning: undefined module attribute @version, please remove access to @version or explicitly set it before access
Interactive Elixir (1.2.0) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>
defmodule Iphod.Mixfile do
use Mix.Project
def project do
[app: :iphod,
version: "0.0.1",
elixir: "~> 1.2.0",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
ChangeDay day ->
let
bar =
Signal.send tomorrowFrom.address model.today
|> Task.toMaybe
|> Task.map NoOp
|> Effects.task
in
(model, Effects.none)