https://github.com/talko/fprofx
erlc src/fprofx.erl
path: _build/dev/lib/fprofx/ebin/
iex -S mix
:fprofx.apply(SBS, :config, ["fooo"], [{:procs, :erlang.processes -- [:erlang.whereis(:fprofx_server)]}])
#! /usr/bin/env bash | |
# Script to install NixOS from the Hetzner Cloud NixOS bootable ISO image. | |
# (tested with Hetzner's `NixOS 20.03 (amd64/minimal)` ISO image). | |
# | |
# This script wipes the disk of the server! | |
# | |
# Instructions: | |
# | |
# 1. Mount the above mentioned ISO image from the Hetzner Cloud GUI |
#!/bin/bash | |
name=$1 | |
cluster=$2 | |
td_json=$(aws ecs describe-task-definition --task-definition ${cluster}-${name} | jq 'map({family, networkMode, containerDefinitions, volumes})' | jq '.[0]') | |
aws ecs register-task-definition --cli-input-json $td_json | |
aws ecs update-service --service ${cluster}-${name} --task-definition ${cluster}-${name} --region eu-west-1 --cluster ${cluster} |
defmacro defbang({ name, _, args }) do | |
unless args |> is_list do | |
args = [] | |
end | |
quote bind_quoted: [name: Macro.escape(name), args: Macro.escape(args)] do | |
def unquote(to_string(name) <> "!" |> String.to_atom)(unquote_splicing(args)) do | |
case unquote(name)(unquote_splicing(args)) do | |
:ok -> | |
:ok |
# Function | |
CREATE FUNCTION jsonb_merge(JSONB, JSONB) | |
RETURNS JSONB AS $$ | |
WITH json_union AS ( | |
SELECT * FROM JSONB_EACH($1) | |
UNION ALL | |
SELECT * FROM JSONB_EACH($2) | |
) SELECT JSON_OBJECT_AGG(key, value)::JSONB FROM json_union; | |
$$ LANGUAGE SQL; |