(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.
(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.
| defmodule Randomizer do | |
| @moduledoc """ | |
| Random string generator module. | |
| """ | |
| @doc """ | |
| Generate random string based on the given legth. It is also possible to generate certain type of randomise string using the options below: | |
| * :all - generate alphanumeric random string | |
| * :alpha - generate nom-numeric random string |
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
| { pkgs, lib, config, ... }: | |
| { | |
| networking = { | |
| firewall.allowedTCPPorts = [ | |
| 3000 # grafana | |
| 9090 # prometheus | |
| 9093 # alertmanager | |
| ]; | |
| useDHCP = true; | |
| }; |
| # A module containing the function that determines the port number | |
| # based on a node name. | |
| # Taken from https://www.erlang-solutions.com/blog/erlang-and-elixir-distribution-without-epmd.html | |
| defmodule Epmdless do | |
| def dist_port(name) when is_atom(name) do | |
| dist_port Atom.to_string name | |
| end | |
| def dist_port(name) when is_list(name) do | |
| dist_port List.to_string name |
| # http://adventofcode.com/2017/day/3 | |
| defmodule Day3 do | |
| require Integer | |
| def part1(square) do | |
| final_point = | |
| memory_points() | |
| |> Stream.drop_while(&(&1.square != square)) | |
| |> Enum.take(1) |
| /* | |
| It's now a package. You can find it here: | |
| https://github.com/joshnuss/svelte-local-storage-store | |
| */ | |
| // Svelte store backed by window.localStorage | |
| // Persists store's data locally |