• Stars
    star
    484
  • Rank 87,311 (Top 2 %)
  • Language
    Elixir
  • Created almost 3 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of simple Elixir scripts that are using Mix.install/2.

MixInstallExamples

A collection of simple Elixir scripts that are using Mix.install/2. (Requires Elixir v1.12+)

Example

Let's run the example benchee.exs script of the excellent Benchee benchmarking library.

$ git clone https://github.com/wojtekmach/mix_install_examples.git
$ cd mix_install_examples
$ cat benchee.exs
Mix.install([
  {:benchee, "~> 1.0"}
])

list = Enum.to_list(1..10_000)
map_fun = fn i -> [i, i * i] end

Benchee.run(
  %{
    "flat_map" => fn -> Enum.flat_map(list, map_fun) end,
    "map.flatten" => fn -> list |> Enum.map(map_fun) |> List.flatten() end
  },
  time: 10,
  memory_time: 2
)
$ elixir benchee.exs
Operating System: macOS
CPU Information: Apple M1
Number of Available Cores: 8
Available memory: 16 GB
Elixir 1.14.0-dev
Erlang 25.0-rc3

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 10 s
memory time: 2 s
reduction time: 0 ns
parallel: 1
inputs: none specified
Estimated total run time: 28 s

Benchmarking flat_map ...
Benchmarking map.flatten ...

Name                  ips        average  deviation         median         99th %
flat_map           4.44 K      225.22 μs     ±2.98%         224 μs      246.52 μs
map.flatten        2.68 K      372.56 μs    ±24.96%      374.13 μs      560.40 μs

Comparison:
flat_map           4.44 K
map.flatten        2.68 K - 1.65x slower +147.34 μs

Memory usage statistics:

Name           Memory usage
flat_map             625 KB
map.flatten       781.25 KB - 1.25x memory usage +156.25 KB

**All measurements for memory usage were the same**

More Repositories

1

req

Req is a batteries-included HTTP client for Elixir.
Elixir
769
star
2

acme_bank

An example ☂ project
Elixir
748
star
3

oop

OOP in Elixir!
Elixir
294
star
4

mini_repo

MiniRepo allows self-hosting of Hex packages.
Elixir
191
star
5

github_ecto

Ecto adapter for GitHub API
Elixir
120
star
6

elixir-run

Erlang/OTP + Elixir + IEx + Mix in a single executable for Linux/macOS/Windows. Just run Elixir!
Elixir
113
star
7

calendar_interval

Functions for working with calendar intervals
Elixir
66
star
8

hello_beam

Elixir, Erlang, Gleam & LFE code all in the same project!
Erlang
64
star
9

phoenix_example

An example Phoenix app with one-click deployments to different cloud services.
Elixir
62
star
10

rubyfmt

Ruby
46
star
11

minitest-capybara

**Deprecated** Capybara matchers support for minitest unit & spec
Ruby
41
star
12

easyhtml

EasyHTML makes it easy to work with HTML in Elixir.
Elixir
39
star
13

minitest-metadata

Annotate tests with key/value metadata
Ruby
36
star
14

openapi

A proof-of-concept for generating OpenAPI clients in Elixir.
Elixir
28
star
15

calendar_recurrence

Recurrence is an Elixir library for working with recurring dates
Elixir
26
star
16

req_easyhtml

Req plugin for EasyHTML.
Elixir
21
star
17

shipit

ShipIt automates Hex package publishing to avoid common mistakes
Elixir
21
star
18

dotfiles

~wojtek
Shell
20
star
19

embedded_record

Embed objects in a bitmask field. Similar to bitmask-attribute and friends
Ruby
17
star
20

attrs

Yet another attributes on steroids gem
Ruby
17
star
21

ets_ecto

Elixir
16
star
22

easyxml

An experimental easy-to-use XML library for Elixir.
Elixir
13
star
23

system_castore

Elixir
9
star
24

value_inspect

Provides implementation of #inspect that is arguably more readable and can be used in irb.
Ruby
9
star
25

que

Elixir
8
star
26

defc

Elixir
8
star
27

mix_gen_callback

Mix task for generating a callback module for a given behaviour
Elixir
8
star
28

app_manifest

Elixir
8
star
29

beamup-old

Shell
8
star
30

system_target

Elixir
7
star
31

docs_chunks

Erlang
7
star
32

openurl

openurl
Elixir
7
star
33

req_s3

Elixir
6
star
34

jsonapi_ecto

Ecto adapter for any JSON API compatible backend
Elixir
6
star
35

req_hex

Elixir
6
star
36

otp_builds

Shell
6
star
37

beamup

Shell
6
star
38

vim-rename

Rename : Rename a buffer within Vim and on disk (by Christian J. Robinson)
Vim Script
6
star
39

backoff

Elixir
5
star
40

spec

Elixir
5
star
41

req_github_oauth

Elixir
5
star
42

unit

Elixir
5
star
43

bitfield

Elixir
5
star
44

fix

Elixir
5
star
45

poker_elixir

An Elixir library to work with Poker hands.
Elixir
5
star
46

nanorepo

Elixir
5
star
47

otp_docs

Shell
5
star
48

poker

Ruby poker library for evaluating hands
C
4
star
49

global_id

Elixir
4
star
50

goth

Elixir
4
star
51

requests

Elixir
3
star
52

fluentx

Elixir
3
star
53

code_info

Elixir
3
star
54

mix_deps_add

Elixir
3
star
55

docker-beam

Dockerfile
3
star
56

kino_req

Elixir
3
star
57

rebar_ex2erl

Erlang
3
star
58

any_value

Collection of helper methods for testing "shape" of the data
Ruby
3
star
59

req_examples

Elixir
2
star
60

fs

Elixir
2
star
61

token_cache

Elixir
2
star
62

objc

Elixir
2
star
63

modulesdiff

Compare modules & functions between versions
Elixir
2
star
64

phoenix_now

Elixir
2
star
65

iex_help_open

Elixir
2
star
66

twirp_elixir

Elixir
2
star
67

hex_tar

Erlang
2
star
68

decimal_eval

Elixir
2
star
69

changelog

Print changelog of a Hex package
Elixir
2
star
70

sigil_z

Handles the ~Z sigil for UTC date times.
Elixir
2
star
71

mix_zig_cc

Elixir
2
star
72

signups

Experimental app showing how one test can be used on many levels: directly using app logic, against Web UI and API.
Ruby
2
star
73

minitest-capybara-example

Example Rails app for https://github.com/wojtekmach/minitest-capybara
Ruby
2
star
74

spdx

SPDX license list for Elixir
Elixir
2
star
75

automigrate

Elixir
1
star
76

macos_examples

Objective-C
1
star
77

dotlocal

Serve your web app as myapp.local with minimal configuration
Elixir
1
star
78

inspect_record

Elixir
1
star
79

playground

Elixir
1
star
80

readmexec

Readmexec grabs commands from your README and runs them.
Ruby
1
star
81

twittr

Experiment
Elixir
1
star
82

exla

Elixir Client for XLA
C++
1
star
83

wx_demo

Elixir
1
star
84

goth_example

Elixir
1
star
85

chatty

Phoenix chat app. Based on: http://www.youtube.com/watch?v=RPs4SHpSThU
Elixir
1
star
86

catd

Polls for changes in some `foo.d/` directory and concatenates all files into one `foo`
Go
1
star
87

foo

Elixir
1
star
88

wx_examples

Elixir
1
star
89

mr-rebase

A bot that rebases PRs
Elixir
1
star
90

open

Elixir
1
star
91

hippy

JavaScript
1
star
92

bandit_mock

Elixir
1
star
93

cmark_native

Elixir
1
star
94

phoenix_dashboard_clock

Elixir
1
star
95

rss

Elixir
1
star
96

slow_ex_unit

Elixir
1
star
97

elixirsh

Elixir
1
star
98

erl_doc_chunks

Erlang
1
star
99

minimal

Elixir
1
star
100

vcr-proxy

VCR::Proxy records and replays your HTTP interactions.
Ruby
1
star