Skip to content

Instantly share code, notes, and snippets.


Wojtek Mach wojtekmach

View GitHub Profile
wojtekmach / inetrc
Created October 8, 2020 20:03 — forked from nirev/inetrc
Configuring Erlang inet
View inetrc
%% use it by setting the following envvar:
%% export ERL_INETRC="/path/to/this-file"
%% read and monitor nameserver config from here
{resolv_conf, "/etc/resolv.conf"}.
%% increase cache size
{cache_size, 2000}.
%% specify lookup method
View diff-v1.2-v1.3.txt.diff
diff --git a/modules-v1.2.txt b/modules-v1.3.txt
index e88c992ca..89357d0c1 100644
--- a/modules-v1.2.txt
+++ b/modules-v1.3.txt
@@ -1,6 +1,12 @@
View .iex.exs
import_if_available Ext.DateTime
View gist:170555692be81494d38667c36e3ffe69
ericmj [10:24 PM]
the repo includes the registry
the repo is registry + actual packages
the registry is the files that describe the packages in the repo

Keybase proof

I hereby claim:

  • I am wojtekmach on github.
  • I am wojtekmach ( on keybase.
  • I have a public key whose fingerprint is 3791 D11E 23DA 56C6 5187 DB6C C4FA 361F 78AD 78E5

To claim this, I am signing this object:

# This scripts re-runs all migrations in test DB
# and reports (along with exist status 1) any
# not commited changes to schema.rb.
# It's best to run this script on CI and fail the build
# because it means there's a discrepancy between migrations
# and schema.rb. (e.g. someone changed migration inline
# but forgot to redo the migration and update schema.rb.)
View gist:d65f26645fec302e7dbc
- TBD - we might want to rewrite/replace existing email notifications for AL to use batches API
- TBD - we might need to use a separate Sidekiq batch for keyword "enqueing" and keyword "refreshment", since they happen on separate queues
wojtekmach / value_object.rb
Last active August 29, 2015 14:19
View value_object.rb
require 'virtus'
module ValueObject
def {
include Virtus.value_object
values do
View anything.rb
# Sometimes, especially when working with JSON APIs,
# when testing I found myself wanting to test the "shape" of data and
# only some particular elements, rather than either:
# 1. test everything - which is tricky with things like auto_increment primary keys,
# created_at fields etc
# 2. test only subset of data - do stuff like:
# `JSON(response.body).map { |h| h['name'] }.should == ['Item 1', 'Item 2']
# Here, I want to try something different. See:
wojtekmach / elixir.json
Last active August 29, 2015 14:17
View elixir.json
"name": "Elixir",
"created_by": "José Valim",
"based_on": "erlang"