Skip to content

Instantly share code, notes, and snippets.

Olle Jonsson olleolleolle

Block or report user

Report or block olleolleolle

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@olleolleolle
olleolleolle / gh-fixing.md
Last active Jul 15, 2019
Automating mass fixes, pt I
View gh-fixing.md

Finding and fixing RubyGems

Lots of gems have outdated gemspec files.

Known Deprecations

  • [autorequire]
  • [default_executable]
  • [rubyforge_project]
  • [specification_version]
@olleolleolle
olleolleolle / hm.md
Last active Mar 22, 2019
An interaction
View hm.md
it "bails" do
begin
cli.parse_options(["--config=#{file}"])
rescue => e
pp e
pp e.cause
pp e.backtrace
end
end
@olleolleolle
olleolleolle / rubocop.md
Created Mar 19, 2019
RuboCop 0.66.0 has trouble with this piece of code
View rubocop.md

In This PR, I disabled a rule inline.

module Gemstash
  # Storage for application-wide variables and configuration.
  class Env
    module Helper
    # RuboCop 0.66.0 can not decide where to put that "private"

    private # rubocop:disable Layout/IndentationWidth
View gist:034040791bc3dd6a3bccd1cf848f5b0b
{
"name": "blockUI",
"title": "BlockUI",
"description": "Simulate synchronous ajax by blocking - not locking - the UI. This plugin lets you block user interaction with the page or with a specific element on the page. Also great at displaying modal dialogs.",
"keywords": [
"block",
"overlay",
"dialog",
"modal"
],
View Rakefile
desc 'Use ampersand in argument to system'
task :runbatch do |task_name, args|
command = 'tbat.bat && cmd /c start tbattwo.bat'
puts command
system command
end
View client.rb
# client.rb
require 'drb/drb'
DRb.start_service
remote_object = DRbObject.new_with_uri('druby://localhost:9999')
p remote_object.greet #=> 'Hello, world!'
View NEWS-in-25.md

This bug will track all NEWS items new in Ruby 2.5. This list is based off https://github.com/ruby/ruby/blob/trunk/NEWS.

Only changes relevant to JRuby are listed here. MRI-specific internal changes and features are not included.

NOTE: Pull requests should be done against the ruby-2.5 branch.

Language changes

View gist:4d6ce55ac43a9d939530cbdbdf2855f8
module Opener
module Core
module Syslog
def self.enabled?
false
end
end
end
end
@olleolleolle
olleolleolle / mri-vs-jruby-on-scan-with-x.md
Last active Oct 30, 2017
Swedish characters are hard to pick up graphemes for
View mri-vs-jruby-on-scan-with-x.md

MRI

2.4.2 :038 > 'åäöÅÄÖ'.unicode_normalize(:nfd).scan(/\X/)
 => ["å", "ä", "ö", "Å", "Ä", "Ö"]
 

JRuby

View http_diff.diff
263,264c263
< # Net::HTTP.start(uri.host, uri.port,
< # :use_ssl => uri.scheme == 'https') do |http|
---
> # Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http|
266d264
< #
269a268,274
> # Or if you simply want to make a GET request, you may pass in an URI
> # object that has a HTTPS URL. Net::HTTP automatically turn on TLS
You can’t perform that action at this time.