(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/usr/bin/env elixir | |
| # | |
| # A Template for writing an Elixir script to be used on the | |
| # command-line. | |
| # | |
| # (c) 2019 by Andreas Altendorfer <andreas@altendorfer.at> | |
| # License: Free to use without any warranty. | |
| # | |
| # Usage: | |
| # 1. Add your command to strict and aliases on @opts |
| DROP DATABASE IF EXISTS 📚; | |
| CREATE DATABASE 📚; | |
| USE 📚; | |
| CREATE TABLE 👤( | |
| 🔑 INTEGER PRIMARY KEY, | |
| 🗣 varchar(64), -- name | |
| 🗓 DATE -- date of registration |
| trait ResId { | |
| def toASCIIString: String | |
| } | |
| object ResId { | |
| def apply(uri: String): ResId = new StringUri(uri) | |
| def apply(uri: URI): ResId = new StringUri(uri.toString) | |
| private def validated(uri: String): String = URI.create(uri).toString | |
| case class StringUri(value: String) extends ResId { | |
| override val toASCIIString: String = validated(value) |
| const I = x => x | |
| const K = x => y => x | |
| const A = f => x => f (x) | |
| const T = x => f => f (x) | |
| const W = f => x => f (x) (x) | |
| const C = f => y => x => f (x) (y) | |
| const B = f => g => x => f (g (x)) | |
| const S = f => g => x => f (x) (g (x)) | |
| const S_ = f => g => x => f (g (x)) (x) | |
| const S2 = f => g => h => x => f (g (x)) (h (x)) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| license: gpl-3.0 |
| BTW HAI WORLD in LOLCODE ("BTW" means comment) | |
| HAI | |
| CAN HAS STDIO? | |
| VISIBLE "HAI WORLD!" | |
| KTHXBYE |