Skip to content

Instantly share code, notes, and snippets.

# There are some issues with installing mysql2 with osx 10.14.
# The issues are because apple replaced openssl with libressl as a default
# encryption library.
#
# This makes some versions of the `mysql2` ruby gem very hard to install if you don't
# know how to circumvent it.
# My way of doing it was to install the latest version of mysql and install the gem
# manually with flags telling it to use openssl over libressl:
gem install mysql2 -v '0.5.2' -- --with-cflags=\"-Iusr/local/opt/openssl/include\" --with-ldflags=\"-L/usr/local/opt/openssl/lib\"
@johantell
johantell / app_version
Created November 18, 2018 18:05
Script to get the current version from an elixir mix file without the need for elixir
#!/bin/sh
set -e
root=$(cd "$(dirname "$0")/.." && pwd)/
cat "$root/mix.exs" | grep version | sed -e 's/.*version: "\(.*\)",/\1/'
@johantell
johantell / electron_main.js
Created June 17, 2016 06:35
Surviving a hanged process in electron
const electron = require('electron')
const { BrowserWindow, app } = electron
app.on('ready', () => {
let win = new BrowserWindow()
win.on('unresponsive', function(event){
console.log('unresponsive')
win.destroy()
app.exit(9)