Skip to content

Instantly share code, notes, and snippets.

View eiri's full-sized avatar
🐈‍⬛
Diving into Rust

Eric Avdey eiri

🐈‍⬛
Diving into Rust
View GitHub Profile
@eiri
eiri / nerd_font.py
Last active July 30, 2020 15:05
nerd font, print devicons range
def print_nerd_font():
print('# Nerd - Pomicons:')
for c in range(0xe000, 0xe00b):
print(f'{hex(c)} - {chr(c)}')
print('# Nerd - Powerline + extra:')
for c in range(0xe0a0, 0xe0a4):
print(f'{hex(c)} - {chr(c)}')
for c in range(0xe0b0, 0xe0c9):
print(f'{hex(c)} - {chr(c)}')
@eiri
eiri / README.md
Last active April 19, 2020 21:51
Aegis key cache flow chart
@eiri
eiri / acounter.escript
Created March 24, 2020 15:07
Demo on how foundationdb atomic counters update in one transaction cancels all the read transactions
#!/usr/bin/env escript
%% -*- erlang -*-
%%! -s -pa src/erlfdb/ebin
-define(CLUSTER_FILE, <<"/usr/local/etc/foundationdb/fdb.cluster">>).
-define(DIR, <<"test">>).
-define(KEY, <<"counter">>).
-define(TIMEOUT, 1000).
@eiri
eiri / README.md
Created February 28, 2020 17:31
Slash and transform json file with jq

Grab a data file. "American movies scraped from Wikipedia" is a nice condence set at size 3.4M wget https://raw.githubusercontent.com/prust/wikipedia-movie-data/master/movies.json -O movies.json

Slice movies made from 1920 till 1930 and output them line by line

jq -cr '.[] | select(.year >= 1920 and .year <= 1930)' movies.json

Pass the output to reducer to group by year, calculate total movies per year and accumulate movies into "movies" array in each block

@eiri
eiri / README.md
Created January 14, 2020 15:37
Using `cheat` - command line helper tool
@eiri
eiri / Makefile
Created November 22, 2019 06:27
Testing facilities for removing of view_changes from CouchDB
sub.DEFAULT_GOAL := check
.EXPORT_ALL_VARIABLES:
CURL_HOME = $(CURDIR)
JAR = $(CURDIR)/jar
DB = http://localhost:15984
ADM_CRD = '{"username":"admin", "password": "admin"}'
USR_CRD = '{"name":"eiri", "password": "eiri"}'
@eiri
eiri / README.md
Created April 16, 2019 22:23 — forked from magnetikonline/README.md
Bash string manipulation cheatsheet.

Bash string manipulation cheatsheet

Assignment
Assign value to variable if variable is not already set. Value will be returned.

Couple with : no-op if return value is to be discarded.
${variable="value"}
: ${variable="value"}
@eiri
eiri / Dockerfile
Created March 21, 2019 23:51
gitbook in docker
FROM node:8.11-alpine
RUN npm install --global gitbook-cli && \
gitbook fetch 3.2.2 && \
gitbook install && \
npm cache clear --force && \
rm -rf /tmp/*
# Fixes https://github.com/GitbookIO/gitbook/issues/1309
RUN sed -i.bak 's/confirm: true/confirm: false/g' \
@eiri
eiri / fix.md
Created February 21, 2019 15:13
Fix 500 login error on new App Store in macOS Mojave
@eiri
eiri / .kerlrc
Created January 29, 2019 15:07
kerl config, saved for posterity
KERL_DEFAULT_INSTALL_DIR=/opt/erlang
KERL_CONFIGURE_OPTIONS="--enable-debug --without-javac --enable-shared-zlib --enable-dynamic-ssl-lib --disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll --with-wx --with-ssl=/usr/local/opt/openssl"