Skip to content

Instantly share code, notes, and snippets.

@abinoam
abinoam / ruby_versions.md
Last active August 29, 2015 14:16
Ruby Versions. Launching and retirement.

Ruby Versions

Retired

  • 1.8.7 - Retired since 2013-06-30

  • 1.9.3 - Retired since 2015-02-23 - No bug fix, nor even security ones will be backported then

Security Maintenance Phase

@abinoam
abinoam / codeship_heroku_with_maintenance_mode.sh
Created March 20, 2015 15:30
Codeship custom script for Heroku deploying with maintenance mode
#!/bin/sh
# This codeship custom script depends on:
# - API_KEY env var from Heroku
# - STAGING_APP_NAME
# - STAGING_APP_URL
set -e
export HEROKU_API_KEY="${API_KEY}"
@abinoam
abinoam / rbreadline_multibyte_test.rb
Created September 10, 2015 03:43
RbReadline multibyte support test
#coding: utf-8
# This will remove old Readline if it's already defined
require 'rb-readline'
# This will load RbReadline for real
require 'rbreadline'
# This will load Readline that relies on RbReadline
require 'readline'
@abinoam
abinoam / after_commit_error.rb
Created August 29, 2017 22:14
Bug at paranoia 2.3.1 / rails 5.1.x
# frozen_string_literal: true
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
@abinoam
abinoam / frontend_api.rb
Created July 9, 2018 16:58 — forked from ErvalhouS/frontend_api.rb
A read-only frontend API abstraction applicable to any application.
# frozen_string_literal: true
module Api
module V1
# Controller to consume read-only data to be used on client's frontend
class FrontEndController < ActionController::API
include Orderable
# GET /:resource
# GET /:resource.json
@abinoam
abinoam / hanami_snippet.rb
Last active July 27, 2018 15:05
A Hanami Snippet to show a callable controller
# Example from: http://hanamirb.org/guides/1.2/getting-started/#implementing-create-action
module Web::Controllers::Books
class Create
include Web::Action
def call(params)
BookRepository.new.create(params[:book])
redirect_to '/books'