Skip to content

Instantly share code, notes, and snippets.

View richardsondx's full-sized avatar

Richardson Dackam richardsondx

View GitHub Profile
@richardsondx
richardsondx / compress_requests.rb
Created March 9, 2016 20:43 — forked from relistan/compress_requests.rb
Rack Middleware to automatically unzip gzipped/deflated POST data
class CompressedRequests
def initialize(app)
@app = app
end
def method_handled?(env)
!!(env['REQUEST_METHOD'] =~ /(POST|PUT)/)
end
def encoding_handled?(env)
@richardsondx
richardsondx / Gemfile
Last active March 9, 2016 19:51
ERROR: Authentication failure! invalid_credentials: OAuth2::Error - jruby 9.0.5.0 - rails 3.2.13 - devise 3.2.4 - omniauth-google-oauth2 0.3.1
source 'http://rubygems.org'
gem 'rails', '3.2.13'
group :assets do
gem 'sass-rails', " ~> 3.2.3"
gem 'coffee-rails', " ~> 3.2.1"
gem 'uglifier', '>=1.0.3'
#gem 'turbo-sprockets-rails3'
end
@richardsondx
richardsondx / Gemfile.lock
Last active March 9, 2016 04:25
What am I missing?
oauth2 (1.1.0)
faraday (>= 0.8, < 0.10)
jwt (~> 1.0, < 1.5.2)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.3.1)
hashie (>= 1.2, < 4)
rack (>= 1.0, < 3)
omniauth-google-oauth2 (0.3.1)
@richardsondx
richardsondx / error.txt
Last active June 13, 2018 03:16
undefined class/module Rack::Handler::Servlet::DefaultEnv
# jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 25.72-b15 on 1.8.0_72-b15 +jit [darwin-x86_64]
# Rails 3.2.13
cache error: undefined class/module Rack::Handler::Servlet::DefaultEnv
org/jruby/RubyMarshal.java:145:in `load'
/Users/richardson/.rvm/gems/jruby-9.0.5.0/gems/actionpack-3.2.13/lib/action_dispatch/http/rack_cache.rb:18:in `read'
/Users/richardson/.rvm/gems/jruby-9.0.5.0/gems/rack-cache-1.6.1/lib/rack/cache/meta_store.rb:30:in `lookup'
/Users/richardson/.rvm/gems/jruby-9.0.5.0/gems/rack-cache-1.6.1/lib/rack/cache/context.rb:173:in `lookup'
/Users/richardson/.rvm/gems/jruby-9.0.5.0/gems/rack-cache-1.6.1/lib/rack/cache/context.rb:66:in `call!'
/Users/richardson/.rvm/gems/jruby-9.0.5.0/gems/rack-cache-1.6.1/lib/rack/cache/context.rb:51:in `call'
@richardsondx
richardsondx / solution.md
Created March 4, 2016 14:47 — forked from kendagriff/solution.md
Solution to "OpenSSL::X509::StoreError: setting default path failed: Invalid keystore format" for JRuby

Solution to StoreError: invalid keystore format (OS X)

The following error appeared upon upgrading JRuby:

OpenSSL::X509::StoreError: setting default path failed: Invalid keystore format

Download cacert.pem

@richardsondx
richardsondx / howto-manually-add-trust-cert-to-rubygems.md
Created March 4, 2016 07:15
Workaround RubyGems' SSL errors on Ruby for Windows (RubyInstaller)

SSL upgrades on rubygems.org and RubyInstaller versions

UPDATE 2014-12-21: RubyGems 1.8.30, 2.0.15 and 2.2.3 have been released. It requires manual installation, please see instructions below.


Hello,

If you reached this page, means you've hit this SSL error when trying to

@richardsondx
richardsondx / ssl_puma.sh
Created February 25, 2016 18:40 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@richardsondx
richardsondx / abstract_mysql2_adapter.rb
Last active February 10, 2016 23:19
Fix for ActiveRecord::JDBCError: All parts of a PRIMARY KEY must be NOT NULL;
# class ActiveRecord::ConnectionAdapters::Mysql2Adapter
module ActiveRecord
module ConnectionAdapters
class AbstractMysqlAdapter < AbstractAdapter
# https://github.com/rails/rails/blob/a4b55827721a5967299f3c1531afb3d6d81e4ac0/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb#L113-L126
NATIVE_DATABASE_TYPES = {
:primary_key => "int(11) auto_increment PRIMARY KEY",
:string => { :name => "varchar", :limit => 255 },
:text => { :name => "text" },
:integer => { :name => "int", :limit => 4 },
@richardsondx
richardsondx / .vimrc
Created September 3, 2015 14:33
My .vimrc with molokai
set nocompatible
" Vundle Plugins
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'pangloss/vim-javascript'
@richardsondx
richardsondx / .vimrc
Created August 31, 2015 22:02
copy of Rowel ~/.vimrc
set nocompatible
set background=dark
" Vundle Plugins
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'jelera/vim-javascript-syntax'