Skip to content

Instantly share code, notes, and snippets.

View tombruijn's full-sized avatar

Tom de Bruijn tombruijn

View GitHub Profile
@tombruijn
tombruijn / keybase.md
Created March 26, 2015 11:52
keybase.md

Keybase proof

I hereby claim:

  • I am tombruijn on github.
  • I am tombruijn (https://keybase.io/tombruijn) on keybase.
  • I have a public key whose fingerprint is D81B 2BFB CD75 EB0A A348 A240 86CF A78E B98D 8B50

To claim this, I am signing this object:

@tombruijn
tombruijn / output
Last active August 29, 2015 14:18
Wrap lines memory
"lines_map"
{:FREE=>-1506, :T_STRING=>1521, :T_ARRAY=>100, :T_DATA=>0, :T_MATCH=>0, :T_NODE=>0}
"each_line_inject"
{:FREE=>-1901, :T_STRING=>1500, :T_ARRAY=>0, :T_DATA=>100, :T_MATCH=>0, :T_NODE=>300}
"map_if"
{:FREE=>-2001, :T_STRING=>1900, :T_ARRAY=>100, :T_DATA=>0, :T_MATCH=>0, :T_NODE=>0}
"reject_map"
{:FREE=>-1801, :T_STRING=>1600, :T_ARRAY=>200, :T_DATA=>0, :T_MATCH=>0, :T_NODE=>0}
"gsub"
{:FREE=>-1602, :T_STRING=>1301, :T_ARRAY=>0, :T_DATA=>0, :T_MATCH=>200, :T_NODE=>100}
@tombruijn
tombruijn / appsignal gem make output
Last active September 11, 2016 13:22
Ruby gem make output rust staticlib
appsignal@0a517cf25b95:~/appsignal-ruby/ext$ ruby extconf.rb
checking for appsignal_start() in -lappsignal... yes
checking for appsignal-agent in /home/appsignal/appsignal-ruby/ext... yes
checking for appsignal.h in /home/appsignal/appsignal-ruby/ext... yes
creating Makefile
appsignal@0a517cf25b95:~/appsignal-ruby/ext$ make
compiling appsignal_extension.c
linking shared-object appsignal_extension.so
/usr/bin/ld: ./libappsignal.a(sigaction.lo): relocation R_X86_64_PC32 against protected symbol `__restore' can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value
@tombruijn
tombruijn / capybara_ip_stub.rb
Created November 23, 2016 13:29
Fake an ip address on a capybara request
around do |example|
# Set custom IP address
original_app = Capybara.app
Capybara.app = lambda do |env|
Rails.application.call(env.merge("REMOTE_ADDR" => "8.8.8.8"))
end
example.run
Capybara.app = original_app
end
@tombruijn
tombruijn / config_application.rb
Last active May 5, 2017 14:19
AppSignal Rails 5.1 workaround
# config/application.rb
# Workaround for making the AppSignal gem work on Rails 5.1.
# Put this after your Rails app module is defined.
# E.g. `module TestApp; class Application < Rails::Application`.
# Safest location being at the end of the `config/application.rb` file.
# Create a new middleware class with a different name so that when the original
# middleware is deleted the newly added one isn't deleted as well, since Rails
# Custom method to track exceptions regardless if an AppSignal transaction is
# currently active.
#
# When an AppSignal transaction is already active for this thread, it will add
# the exception to the currently active transaction. Note that only one
# exception can be added a transaction.
#
# When no AppSignal transactions are active for this thread it will create one
# temporarily, add the exception to the temporary transaction and send it to
# AppSignal.

Keybase proof

I hereby claim:

  • I am tombruijn on github.
  • I am tombruijn (https://keybase.io/tombruijn) on keybase.
  • I have a public key ASAWMmghMGGNT9nCA0asFbiezsQiCiiCqDytMjE8qiTGwAo

To claim this, I am signing this object:

/app/_build/prod/lib/elixir_package/priv/libelixir_package_extension.a(divdf3.o): In function `__divdf3':
divdf3.c:(.text.__divdf3+0x0): multiple definition of `__divdf3'
/app/_build/prod/lib/elixir_package/priv/libelixir_package_extension.a(compiler_builtins-a6b6fad6cc543169.compiler_builtins0.rcgu.o):/checkout/src/rustc/compiler_builtins_shim/../../libcompiler_builtins/src/macros.rs:253: first defined here
/app/_build/prod/lib/elixir_package/priv/libelixir_package_extension.a(divsf3.o): In function `__divsf3':
divsf3.c:(.text.__divsf3+0x0): multiple definition of `__divsf3'
/app/_build/prod/lib/elixir_package/priv/libelixir_package_extension.a(compiler_builtins-a6b6fad6cc543169.compiler_builtins0.rcgu.o):/checkout/src/rustc/compiler_builtins_shim/../../libcompiler_builtins/src/macros.rs:253: first defined here
/app/_build/prod/lib/elixir_package/priv/libelixir_package_extension.a(muldf3.o): In function `__muldf3':
muldf3.c:(.text.__muldf3+0x0): multiple definition of `__muldf3'
/app/_build/prod/lib/elixir_p
/app/_build/prod/lib/elixir_package/priv/libelixir_package_extension.a(floatdisf.o): In function `__floatdisf':
floatdisf.c:(.text.__floatdisf+0x0): multiple definition of `__floatdisf'
/app/_build/prod/lib/elixir_package/priv/libelixir_package_extension.a(compiler_builtins-874d313336916306.compiler_builtins0-efdbf1bd2f3b1e3c9741f8dcfa1f7012.rs.rcgu.o):/checkout/src/rustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/conv.rs:89: first defined here
collect2: error: ld returned 1 exit status
@tombruijn
tombruijn / Dockerfile
Created July 10, 2020 15:54
CentOS 7.8.2003 + Ruby 2.3.0 Dockerfile
FROM centos:centos7.8.2003
RUN yum install -y git gcc gcc-c++ make openssl-devel bzip2 wget && \
cd ~/ && mkdir tmp && cd tmp && \
wget -O ruby-install-0.7.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.7.0.tar.gz && \
tar -xzvf ruby-install-0.7.0.tar.gz && \
cd ruby-install-0.7.0/ && \
make install
RUN ruby-install ruby 2.3.0