Skip to content

Instantly share code, notes, and snippets.

@neongreen
neongreen / View.hs
Last active November 11, 2021 10:14
Integrating Tiptap with IHP. See https://windofchange.me/ShowCard?cardId=1d4e2e31-f319-4d01-9798-f775e321fdb1 for latest updates.
-- Example of a form using tiptap
renderForm :: CardUpdate -> Html
renderForm cardUpdate = formFor cardUpdate [hsx|
{(textareaField #content) {
disableLabel = True,
fieldClass = "use-tiptap"
}
}
{submitButton {label = "Save"}}
let List/map =
https://prelude.dhall-lang.org/List/map sha256:dd845ffb4568d40327f2a817eb42d1c6138b929ca758d50bc33112ef3c885680
let Text/concat =
https://prelude.dhall-lang.org/Text/concat sha256:731265b0288e8a905ecff95c97333ee2db614c39d69f1514cb8eed9259745fc0
let Optional/fold =
https://prelude.dhall-lang.org/Optional/fold
sha256:c5b9d72f6f62bdaa0e196ac1c742cc175cd67a717b880fb8aec1333a5a4132cf
// skypack pinned URLs can be obtained by visiting links like 'https://cdn.skypack.dev/@tiptap/core'
import { Editor, Extension } from 'https://cdn.skypack.dev/pin/@tiptap/[email protected]/mode=imports,min/optimized/@tiptap/core.js';
import StarterKit from 'https://cdn.skypack.dev/pin/@tiptap/[email protected]/mode=imports,min/optimized/@tiptap/starter-kit.js';
import Typography from 'https://cdn.skypack.dev/pin/@tiptap/[email protected]/mode=imports,min/optimized/@tiptap/extension-typography.js';
import HardBreak from './tiptap-hard-break.js';
import CodeBlock from './tiptap-code-block.js';
import Link from './tiptap-link.js';
import TurndownService from 'https://cdn.skypack.dev/pin/[email protected]/mode=imports,min/optimized/turndown.js';
import * as commonmark from 'https://cdn.skypack.dev/pin/[email protected]/mode=imports,min/optimized/commonmark.js';
@neongreen
neongreen / artyom.css
Last active January 3, 2021 03:59
Themes
/* artyom.brick.do */
@import url('https://fonts.googleapis.com/css2?family=Carter+One&family=Averia+Serif+Libre:ital,wght@0,400;0,700;1,400;1,700&display=swap');
figure {
border: 1px solid #aaa;
border-bottom: none;
}
figcaption {
find . -name "*.html" -type f -exec sh -c \
'dir=`dirname "$1"`; name=`basename "$1"`; (cd "$dir" && pandoc "$name" --self-contained -o "$name")' x {} +
#!/usr/bin/env stack
-- stack --resolver lts-13.26 script --package purescript --extra-dep aeson-1.4.7.1 --extra-dep serialise-0.2.2.0 --extra-dep cborg-0.2.2.0 --extra-dep happy-1.19.9 --extra-dep language-javascript-0.7.0.0 --extra-dep network-3.0.1.1 --extra-dep these-1.0.1 --extra-dep semialign-1 --extra-dep assoc-1.0.1 --extra-dep bifunctors-5.5.7 --extra-dep th-abstraction-0.3.2.0 --extra-dep time-compat-1.9.3 --package text --optimize
{-# LANGUAGE LambdaCase #-}
import Data.List
import Data.List.NonEmpty (toList)
import qualified Data.Text.IO as T
import Language.PureScript.CST.Errors
import Language.PureScript.CST.Parser
#include <Arduboy2.h>
#include <ArduboyTones.h>
#include <stdint.h>
#include <EEPROM.h>
Arduboy2 arduboy;
ArduboyTones sound(arduboy.audio.enabled);
/*
Changelog:
let List/map =
https://prelude.dhall-lang.org/List/map sha256:dd845ffb4568d40327f2a817eb42d1c6138b929ca758d50bc33112ef3c885680
let Text/concat =
https://prelude.dhall-lang.org/Text/concat sha256:731265b0288e8a905ecff95c97333ee2db614c39d69f1514cb8eed9259745fc0
let JSON =
https://prelude.dhall-lang.org/JSON/package.dhall sha256:0c3c40a63108f2e6ad59f23b789c18eb484d0e9aebc9416c5a4f338c6753084b
let Map =