This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Run the following in your developer console */ | |
(function restyle_slack() { | |
let css_body = ` | |
.p-channel_sidebar { | |
background-color: #222222 !important; | |
} | |
#team_menu { | |
background-color: #222222 !important; | |
border-bottom-color: #222222 !important; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stress_tester.exs | |
total_requests = 200 | |
concurrency = 10 | |
url = 'https://httpbin.org/anything' | |
method = :post | |
payload = '{"some": "data"}' | |
:inets.start() | |
:ssl.start() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------- Binary key ---------------- | |
bin_really_small_map = | |
1..8 | |
|> Enum.map(fn val -> {"key_#{val}", "#{val}"} end) | |
|> Map.new() | |
bin_small_map = | |
1..32 | |
|> Enum.map(fn val -> {"key_#{val}", "#{val}"} end) | |
|> Map.new() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------- Setup test data ---------------- | |
small_map_as_term = %{ | |
some: "value", | |
another: "key", | |
some_list: [1, 2, 3, 4, 5], | |
nil_value: nil | |
} | |
big_map_as_term = %{ | |
payload: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Application.put_env(:elixir, :ansi_enabled, true) | |
IEx.configure( | |
default_prompt: [ | |
"\e[G", :black_background, :bright, :white, "%prefix", :blue, "(%counter)", :default_background, :white, " ▶", :reset | |
] |> IO.ANSI.format() |> IO.chardata_to_string() | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env elixir | |
# Install required deps | |
Mix.install([:jason]) | |
# The pretty printing module | |
defmodule JsonPrettyPrinter do | |
def get_stdin_data do | |
# Fetch data from STDIN and decode JSON | |
:stdio |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Untitled notebook | |
```elixir | |
Mix.install([ | |
{:kino_benchee, github: "livebook-dev/kino_benchee"}, | |
{:benchee, | |
github: "bencheeorg/benchee", branch: "akoutmos-adding-table-support", override: true} | |
]) | |
``` |