Conway's Game of Life in Erlang, in 2 hours, with 0 Erlang experience, in 20 lines of code.
1337 h4x0rs:
- @jszmajda
- @ngauthier
- @ericoestrich
- @danivovich
- @kafuchau
Conway's Game of Life in Erlang, in 2 hours, with 0 Erlang experience, in 20 lines of code.
1337 h4x0rs:
| # This function is only included for context - it creates a multi-operation transaction structure | |
| # for a single widget and its associated options | |
| def create_multi(params, operation_type, widget, identifier \\ :widget) do | |
| changeset = Widget.changeset(widget, params) | |
| apply(Ecto.Multi, operation_type, [Ecto.Multi.new(), identifier, changeset]) | |
| |> maybe_merge_widget_options(identifier, params) | |
| end | |
| # Here's the usage of reduce. Notice the map + "mappend"(?) inside the reduce. If Ecto.Multi |
| ;; Support mix format command | |
| (defun alchemist-mix-format (&optional prefix) | |
| "Runs mix format in the project" | |
| (interactive) | |
| (alchemist-mix-execute (list "format") prefix)) | |
| (defun alchemist-mix-format-buffer (&optional prefix) | |
| "Runs mix format on the current buffer" | |
| (interactive) |
| defmodule Mix.Tasks.PrintCode do | |
| @shortdoc "Prints decompiled Erlang source for a module" | |
| @moduledoc """ | |
| Pretty-prints the *Erlang-equivalent* source code of an *Elixir* | |
| module. This is useful for understanding how particular Elixir | |
| features (e.g. macros, protocols) operate under the covers. | |
| *Erlang modules are not yet supported.* |
Resources are listed in no particular order.
| ;; Use org-babel to load config | |
| (require 'org) | |
| (org-babel-load-file (expand-file-name "seancribbs.org" user-emacs-directory)) |
| %% @doc A VERY EVIL parse_transform that allows two things: | |
| %% | |
| %% 1) The use of 'else' instead of 'true' in the final clause of an if | |
| %% expression. | |
| %% | |
| %% 2) Automatic extraction of non-guard expressions into | |
| %% anonymous variables that can then be used directly in the clause | |
| %% guards. | |
| %% | |
| %% Until Erlang actually implements the 'cond' construct, this is a |
| ** (Protocol.UndefinedError) protocol String.Chars not implemented for {:git, 'git://github.com/basho/lager.git', {:tag, '2.1.1'}} | |
| (elixir) lib/string/chars.ex:3: String.Chars.impl_for!/1 | |
| (elixir) lib/string/chars.ex:17: String.Chars.to_string/1 | |
| (mix) lib/mix/rebar.ex:122: Mix.Rebar.compile_req/1 | |
| (mix) lib/mix/rebar.ex:88: Mix.Rebar.parse_dep/2 | |
| (elixir) lib/enum.ex:977: anonymous fn/3 in Enum.map/2 | |
| (elixir) lib/enum.ex:1261: Enum."-reduce/3-lists^foldl/2-0-"/3 | |
| (elixir) lib/enum.ex:977: Enum.map/2 | |
| (mix) lib/mix/dep/loader.ex:250: anonymous fn/2 in Mix.Dep.Loader.rebar_children/1 |
I hereby claim:
To claim this, I am signing this object:
| # Customizations | |
| . ~/.bash/colors.sh | |
| . ~/.bash/editor.sh | |
| . ~/.bash/git.sh | |
| . ~/.bash/erlang.sh | |
| . ~/.bash/ruby.sh | |
| . ~/.bash/ghc.sh | |
| . ~/.bash/prompt.sh | |
| . ~/.bash/gif.sh |