The following are appendices from Optics By Example, a comprehensive guide to optics from beginner to advanced! If you like the content below, there's plenty more where that came from; pick up the book!
This file contains 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
# Inspired by https://engineering.tripping.com/blazing-fast-elixir-configuration-475aca10011d | |
# Updated with more options, including persistent_term and process locals | |
Mix.install([{:benchee, "~> 1.0"}]) | |
Application.put_env(:fast_config, :adapter, TargetModule) | |
:persistent_term.put({:fast_config, :adapter}, TargetModule) | |
defmodule TargetModule do | |
def run, do: :ok |
This file contains 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
defmodule AbsintheCollector do | |
@moduledoc """ | |
Module to collect absinthe telemetry events | |
""" | |
use Prometheus.Metric | |
require Prometheus.Contrib.HTTP | |
@events [ | |
[:absinthe, :resolve, :field, :start], | |
[:absinthe, :resolve, :field], |
This file contains 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
defmodule AggregateCase do | |
@moduledoc """ | |
Defines a test case to be used by aggregate tests. | |
""" | |
use ExUnit.CaseTemplate | |
alias Commanded.Aggregate.Multi | |
using opts do |
This file contains 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
SELECT | |
schema_name, rel_name, table_size, | |
pg_size_pretty(table_size) AS size | |
FROM ( | |
SELECT | |
nspname AS schema_name, | |
relname AS rel_name, | |
pg_table_size(pg_class.oid) AS table_size | |
FROM pg_class, pg_namespace | |
WHERE pg_class.relnamespace = pg_namespace.oid |
This file contains 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
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
let | |
elixir_1_7_0_rc_1 = { mkDerivation }: | |
mkDerivation rec { | |
version = "1.7.0-rc.1"; | |
# Use `nix-prefetch-github --rev <version> elixir-lang elixir` to update. | |
sha256 = "1hp1zdscq7h2qcgcfbzw5dx1wxy05bqlrxvv5kcl8414c69inx8g"; |
This document contains some ideas for additions to the Nix language.
The Nix package manager, Nixpkgs and NixOS currently have several problems:
- Poor discoverability of package options. Package functions have
function arguments like
enableFoo
, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to
This file contains 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
# You will need fswatch installed (available in homebrew and friends) | |
# The command below will run tests and wait until fswatch writes something. | |
# The --stale flag will only run stale entries, it requires Elixir v1.3. | |
fswatch lib/ test/ | mix test --stale --listen-on-stdin |
This file contains 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
import org.csanchez.jenkins.plugins.kubernetes.* | |
import jenkins.model.* | |
def j = Jenkins.getInstance() | |
def k = new KubernetesCloud( | |
'jenkins-test', | |
null, | |
'https://130.211.146.130', | |
'default', |
NewerOlder