Skip to content

Instantly share code, notes, and snippets.

View mvz's full-sized avatar

Matijs van Zuijlen mvz

View GitHub Profile
@mvz
mvz / gtg-export.rb
Created June 6, 2018 12:50
Export Getting Things Gnome tasks to Taskwarrior
#!/usr/bin/env ruby
require 'happymapper'
require 'json'
class Task
include HappyMapper
attribute :id, String
attribute :status, String
@mvz
mvz / habtm_failure_active_record_4_2_8.rb
Created April 24, 2017 12:14
Assigning ids for HABTM relation can't handle duplicates in ActiveRecord 4.2.8
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
# Activate the gem you are reporting the issue against.
@mvz
mvz / Dockerfile
Created March 5, 2017 06:24
Demonstration of bundler issue with nested bundle exec combined with openssl
# Reproduction of nested call bug with bundler 1.14.6
FROM ruby:2.4.0
RUN gem update openssl
RUN mkdir bbug
WORKDIR /bbug
RUN gem install bundler --version '1.14.6'
RUN echo "#!/usr/bin/env ruby\nrequire 'openssl'\np OpenSSL::VERSION" > a.rb
RUN touch Gemfile
@mvz
mvz / Dockerfile
Last active March 1, 2017 08:51
Reproduction of openssl issue with Bundler 1.14.5
# Reproduction of https://github.com/ruby/openssl/issues/103 with bundler 1.14.5
FROM ruby:2.4.0
RUN apt-get update
RUN apt-get install -y nodejs
RUN gem update openssl
RUN gem install rails
RUN rails new bbug
WORKDIR /bbug
RUN echo "gem 'cucumber-rails', group: :test, require: false" >> Gemfile
#!/bin/bash
set -ex
mkdir /tmp/repro-5430
cd /tmp/repro-5430
bundle env
cat > Gemfile <<EOF
@mvz
mvz / config.rb
Created August 28, 2016 18:29
Compiling rbx needs -latomic on Debian Unstable
module Rubinius
config = {}
config[:config_file] = "/home/matijs/src/rubinius-3.56/config.rb"
config[:command_line] = ["--prefix=/home/matijs/.rbenv/versions/rbx-3.56", ""]
config[:build_make] = "make"
config[:build_rake] = "rake"
config[:build_perl] = "perl"
config[:llvm_path] = nil
config[:llvm_system_name] = nil
config[:llvm_configure] = "/usr/bin/llvm-config"
@mvz
mvz / ruby-build-1-9-debian.patch
Created December 4, 2015 13:08
Combined patches to get MRI 1.9.3 to build on Debian Sid
From 1e7a929c1d44d7a368fbe379211183ac6c972920 Mon Sep 17 00:00:00 2001
From: nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Wed, 25 Dec 2013 01:42:09 +0000
Subject: [PATCH] ossl_ssl.c: declare OP_MSIE_SSLV2_RSA_PADDING only if defined
* ext/openssl/ossl_ssl.c (Init_ossl_ssl): Declare a constant
`OP_MSIE_SSLV2_RSA_PADDING` only if the macro is defined. The
`SSL_OP_MSIE_SSLV2_RSA_PADDING` has been removed from latest
snapshot of OpenSSL 1.0.1. [Fixes GH-488]
@mvz
mvz / repro-rbx-platform-issue.sh
Created December 23, 2013 16:18
Script to reproduce problem where :rbx platform seems to be ignored by Bundler
#!/bin/bash
set -ex
mkdir -p /tmp/repro-rbx-platform-issue
cd /tmp/repro-rbx-platform-issue
bundle env
# Bundler 1.3.5
# Ruby 2.0.0 (2013-11-22 patchlevel 353) [x86_64-linux-gnu]
@mvz
mvz / mdv.rb
Created April 17, 2012 08:11
Dead-simple Markdown Viewer
#!/usr/bin/env ruby
require 'ffi-gtk3'
require 'github/markup'
GirFFI.setup :WebKit, '3.0'
Gtk.init
WebKit.set_cache_model :document_viewer
@mvz
mvz / 0001-Explicitely-define-GLib.strv_get_type.patch
Created February 28, 2012 10:49
Patch to hopefully make gir_ffi 0.2.3 work on Ubuntu 11.04
From 61f55004a7ca5bc56448babd2979cd81877e6144 Mon Sep 17 00:00:00 2001
From: Matijs van Zuijlen <matijs@matijs.net>
Date: Tue, 28 Feb 2012 11:01:48 +0100
Subject: [PATCH] Explicitely define GLib.strv_get_type.
On older GLibs, this function is not yet properly introspected.
---
lib/ffi-glib.rb | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)