Skip to content

Instantly share code, notes, and snippets.

insert meme here.

Aldric Giacomoni Trevoke

insert meme here.
Block or report user

Report or block Trevoke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
# This script will setup Evm (Emacs Version Manager) and Cask on
# Travis to use for Emacs Lisp testing.
# In .travis.yml, add this:
# - curl -fsSkL > && source ./
# Emacs 24.3 is installed in the above script because Cask requires
Trevoke / gist:dfa6d886f12d85d7d1d54103d4a808b5
Last active Mar 18, 2018
producer_consumer does not modify events
View gist:dfa6d886f12d85d7d1d54103d4a808b5
# Usage: mix run lib/producer_consumer.exs
# Hit Ctrl+C twice to stop it.
# This is a base example where a producer A emits items,
# which are amplified by a producer consumer B and printed
# by consumer C.
defmodule A do
use GenStage
Trevoke / article.ex
Created Jan 23, 2018 — forked from slashdotdash/article.ex
Commanded multi-entity aggregates
View article.ex
defmodule Article do
defstruct [:content, comments: []]
# public commands
def execute(%Article{}, %PublishArticle{content: content}) do
%ArticlePublished{content: content}
def execute(%Article{}, %CommentOnArticle{} = comment) do

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

Trevoke / unconsult.exs
Created Apr 6, 2017
consulting/unconsulting a file
View unconsult.exs
With thanks to @voltone from the Elixir Slack
defmodule X do
def unconsult(filename, list) do!(filename, [:write], fn file ->
Enum.each(list, &:io.fwrite(file, '~p.~n', [&1]))
Trevoke / gpg.rst
Created Mar 3, 2016 — forked from paul-schwendenman/gpg.rst
GPG Cheatsheet
View gpg.rst

GPG Cheat sheet

A small guide to little things

Create a key


Keybase proof

I hereby claim:

  • I am trevoke on github.
  • I am trevoke ( on keybase.
  • I have a public key whose fingerprint is 48D1 9866 1459 C162 184F FB48 564E 4148 EBF9 21A9

To claim this, I am signing this object:

View hash.ex
# In case anyone is wondering how to easily use the :crypto hash or hmac API's from elixir-land, here you go.!(filename, [:read, {:read_ahead, 65535}], 65535)
|> Enum.reduce(:crypto.hash_init(:sha), &:crypto.hash_update(&2, &1))
|> :crypto.hash_final
|> Base.encode16
# Line 3 opens up a stream, and we're reading in 64KB chunks from the FS which is roughly pretty efficient
# In line 4, we initialize our hash (which returns a context) and put that as the default value in the reducer
# The hash_update in the reducer returns the modified context. Remember arg1 is the item, and arg2 is the accumulator
View gist:3210a94f85eb3edae4a9
·PORT IVY SURFACE MAP··············································································
············B·Z-E-Q-R·····B-B·········································E·Main St····················
You can’t perform that action at this time.