Skip to content

Instantly share code, notes, and snippets.

@bryanhuntesl
bryanhuntesl / shrink a screen recording session
Created June 29, 2021 17:52
shrink a screen recording session
ffmpeg -i front\ end\ betslip\ validation\ session.mp4 -filter:v fps=30 -vcodec libx264 -crf 28 -preset faster -tune out.mp4
RIJPGQMQNQIQLQKPHPHQGQKQIQIQJQCOGOCONPAPAPHPRPPPAPQPGOLPAPAPRP
cat <<EOF | docker build --build-arg=SOURCE=https://github.com/elixir-lang/elixir/archive/master.tar.gz .
FROM alpine
ARG SOURCE
ENV SOURCE=$SOURCE
RUN apk add curl
RUN echo "building source : $SOURCE"
WORKDIR /tmp

Reading the contents of a zip archive file in Elixir

We want to read (and extract all data from) the zip archive file frequency.zip.

Erlang has built in support for reading zip archives.

The documentation is here:

We'll be using :zip.foldl/3 to itterate the file contents.

# Derived from ./manifests
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: prometheus
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: prometheus
version: 2
jobs:
lint:
docker:
- image: circleci/elixir:1.10.3-node-browsers
steps:
- checkout
- restore_cache:
keys:
- v1-elixir-deps-cache-{{ .Branch }}-{{ checksum "mix.lock" }}
docker run --rm -it --privileged --pid=host walkerlee/nsenter -t 1 -m -u -i -n bash
docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(which docker):/bin/docker \
wagoodman/dive:latest $@

lib/transfer_resolver.csv:

10D,1,Signed to 10-Day Contract
10D2,2,Signed to Second 10-Day Contract
ABS,3,Leave of Absence
ACT,4,Activated
BRV,5,Placed on Bereavement List
CEXP,6,Contract Expired
CEXT,,Contract Extension

Creating a function that generates Streams in one line of code

What is a Stream

From the Elixir documentaion :

iex(8)> h Stream.resource