Skip to content

Instantly share code, notes, and snippets.

Avatar

Wojtek Mach wojtekmach

View GitHub Profile
@wojtekmach
wojtekmach / inetrc
Created October 8, 2020 20:03 — forked from nirev/inetrc
Configuring Erlang inet
View inetrc
%% -- ERLANG INET CONFIGURATION FILE --
%% https://erlang.org/doc/apps/erts/inet_cfg.html
%% 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 @@
+Access.all/0
+Access.at/1
+Access.elem/1
Access.fetch/2
Access.get/3
View .iex.exs
import_if_available Ext.DateTime
View gist:170555692be81494d38667c36e3ffe69
ericmj [10:24 PM]
the repo includes the registry
[10:24]
the repo is registry + actual packages
[10:24]
the registry is the files that describe the packages in the repo
[10:25]
View keybase.md

Keybase proof

I hereby claim:

  • I am wojtekmach on github.
  • I am wojtekmach (https://keybase.io/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:

View migrations_integrity.sh
#!/bin/bash
# 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
wojtekmach / value_object.rb
Last active August 29, 2015 14:19
wrapping_virtus.rb
View value_object.rb
require 'virtus'
module ValueObject
def self.new(&block)
Class.new {
include Virtus.value_object
values do
class_eval(&block)
end
}
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
wojtekmach / elixir.json
Last active August 29, 2015 14:17
elixir.json
View elixir.json
{
"name": "Elixir",
"created_by": "José Valim",
"based_on": "erlang"
}