Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dbernheisel on github.
  • I am dbernheisel (https://keybase.io/dbernheisel) on keybase.
  • I have a public key whose fingerprint is 4384 A7D5 19AF C609 E3A0 69D6 437A ABB7 7302 C206

To claim this, I am signing this object:

@dbernheisel
dbernheisel / interface.rb
Created November 29, 2018 14:51
Interfaces in Ruby
module Interface
# For this module to be useful, it'll need to be prepended. For example, if
# you create a CardInterface:
#
# module CardInterface
# extend Interface
# method :photo, returns: [Photo, NilClass]
# end
#
# prepend it to the class:
@dbernheisel
dbernheisel / bump-version.sh
Last active January 15, 2024 03:16
Bash script to bump the version
#!/bin/bash
# Works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3"
# this script will display the current version, automatically
# suggest a "minor" version update, and ask for input to use
# the suggestion, or use a newly entered value.
@dbernheisel
dbernheisel / elixirconf-2018.md
Last active February 26, 2019 05:33
Notes from ElixirConf 2018

ElixirConf 2018

Short Version

Elixir in the Next 5 Years - Jose Valim Video

  • Earlier
  • Community is getting better. New podcasts, frameworks, and faster compilation.
@dbernheisel
dbernheisel / check-tool-version.sh
Last active September 20, 2018 14:43
Tool version checker script
#!/bin/bash
LANGUAGES="erlang elixir nodejs"
get_tool_version() {
grep "$1" .tool-versions | awk '{print $2}'
}
has_matching_versions() {
# Usage: has_matching_versions DEPTH VERSION1 VERSION2
@dbernheisel
dbernheisel / circleci.yml
Last active August 20, 2018 14:32
Ruby, npm/yarn, rspec CircleCI 2.0 Workflows
# Ruby CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
#
# Include the gem 'rspec_junit_formatter' in your test group for circleci to read test results and present them nicely
# Include the gem 'capybara-screenshot' in your test group for screenshot artifacts
version: 2
defaults: &defaults
@dbernheisel
dbernheisel / 2017-04-24-Intro-Elixir-Macros.md
Created November 30, 2017 23:13
Markdown presentation of Elixir Macros
@dbernheisel
dbernheisel / elixir_macro_lightning_talk.html
Last active April 25, 2017 00:37
Elixir Meetup Macro Lightning Talk
<!DOCTYPE html>
<html>
<head>
<title>Elixir Metaprogramming: An Introduction</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Inconsolata:400,700,400italic);
@dbernheisel
dbernheisel / install-new-ssl-with-old-ruby.md
Last active March 30, 2017 01:59
Install modern SSL with old Ruby

Installing Old Rubies

How to tell old-man Ruby to work with the new OpenSSL kids

tldr:

wget https://gist.githubusercontent.com/dbernheisel/82e9bf55d01fe167a815425f77a71cc4/raw/e0af0db1139448e6a32a80d8b94a750644c2d8af/old-jerk-ruby-ssl.patch -O ~/old-jerk-ruby-ssl.patch
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl)" rbenv install --patch 1.8.7-p375 < ~/old-jerk-ruby-ssl.patch

Older Ruby versions (1.8.7 or older) were built with an old OpenSSL version in mind, so if we try to build old Ruby

--- ext/openssl/ossl_pkey_ec.c
+++ ext/openssl/ossl_pkey_ec.c
@@ -757,8 +757,10 @@ static VALUE ossl_ec_group_initialize(int argc, VALUE *argv, VALUE self)
method = EC_GFp_mont_method();
} else if (id == s_GFp_nist) {
method = EC_GFp_nist_method();
+#if !defined(OPENSSl_NO_EC2M)
} else if (id == s_GF2m_simple) {
method = EC_GF2m_simple_method();
+#endif