(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.
# Elixir has lazily evaluated enumerable objects that allow you | |
# to work with enumerable objects like lists either only as needed | |
# or infinitely. | |
# Start up iex to play around | |
$ iex | |
# Typical enumeration is done eagerly where the result is computed ASAP | |
iex> Enum.map(1..10, fn i -> i * 2 end) | |
[2, 4, 6, 8, 10, 12, 14, 16, 18, 20] |
-- Get Max ID from table | |
SELECT MAX(id) FROM table; | |
-- Get Next ID from table | |
SELECT nextval('table_id_seq'); | |
-- Set Next ID Value to MAX ID | |
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |
(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.