Skip to content

Instantly share code, notes, and snippets.

@VaclavSynacek
VaclavSynacek / hiccup-dom-spec.clj
Created July 30, 2018 11:10 — forked from ioRekz/hiccup-dom-spec.clj
Specing valid hiccup dom
(ns hiccup-html-spec.core
(:require [clojure.spec.alpha :as s]
[phrase.alpha :refer [defphraser phrase-first phrase]]))
;;GOALS
;;- spec a valid dom hiccup
;;- have errors like React for
;; . invalid descendant -> "<div> cannot appear as a descendant of <p>"
;; . unknown tag -> "The tag <divv> is unrecognized in this browser"
;; . void element -> "img is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`"
#!/bin/bash
#
# script which reads and outputs DS18S20 temperature reading
# assuming:
# modules w1-gpio and w1-therm loaded into kernel
#
# example - if your DS18S20 id is 28-000001b451d9, then
# to get it's temperature reading in Celsius use:
# DS18S20 28-000001b451d9
#
@VaclavSynacek
VaclavSynacek / xively
Last active August 29, 2015 13:55
Simple script to upload one value to one channel on http://xively.com using only standard unix command line tools. More detaild description at http://vaclav.synacek.com/blog/2014/02/02/xively-data-logging-the-unix-way/
#!/bin/bash
#
# simple script to upload one value to one channel on xively.com
#
# exaple to upload value "23.4" to channel "temperature" use:
# xively temperature 23.4
#
# example to upload value "runnig" to channel "status" use escaping:
# xively status \"running\"
#