Skip to content

Instantly share code, notes, and snippets.

@mtsmfm
mtsmfm / README.md
Last active March 28, 2021 04:36
Ruby hangs when accessing array which is modified in instance_eval after Coverage.start https://bugs.ruby-lang.org/issues/13586

Step to reproduce

git clone https://gist.github.com/b8c57c198793b7e7b835ae3255f0037c.git
cd b8c57c198793b7e7b835ae3255f0037c
docker run --rm -v $PWD:/app -w /app ruby:2.4.1 ruby main.rb
docker run --rm -v $PWD:/app -w /app ruby:2.4.0 ruby main.rb
@mtsmfm
mtsmfm / main.rb
Created June 9, 2017 15:50
Generate OPML file of your GitHub org members' public activity
#
# Generate OPML file of your GitHub org members' public activity
# You can import OPML file from https://feedly.com/i/cortex
#
# Usage: ruby main.rb $GITHUB_API_TOKEN $GITHUB_ORG_NAME
#
require 'net/http'
require 'uri'
require 'json'
I want to say "It is interesting for me the difference how to pass fragments
between relay and apollo because we write attribute which component exactly needs on component directly
on relay js"
https://github.com/relayjs/relay-examples/blob/master/star-wars/js/components/StarWarsShip.js#L24-L30
Sorry for my poor explanation!
@mtsmfm
mtsmfm / a.rb
Last active July 16, 2017 11:33
class A
def hi
puts 'hi'
end
end
A.new.hi
@mtsmfm
mtsmfm / Gemfile
Last active September 16, 2017 03:11
Ruby hangs (`[BUG] rb_gc_mark(): 0x0000000178d240 is T_NONE`)
source 'https://rubygems.org'
gem 'mongo_mapper'
gem 'bson_ext'
gem 'activemodel', '< 5'
@mtsmfm
mtsmfm / progress_bar.rb
Last active August 22, 2017 09:38
Simple progress bar for non tty env
class ProgressBar
def initialize(total_count)
@total_count = total_count
@current_count = 0
@start_at = Time.now
end
def increment
@current_count += 1
class X < BasicObject
MAP = {
fizz: 3,
buzz: 5
}
def initialize(n)
@n = n
@result = nil
end
@mtsmfm
mtsmfm / README.md
Last active November 21, 2017 18:10
wget https://gist.githubusercontent.com/mtsmfm/cb1db1389eeede827936c069bdd85fda/raw/9af1965716fc1635800002fb9b715b9aef98376c/initialize_example
cat initialize_example | bundle exec language_server-ruby
@mtsmfm
mtsmfm / Dockerfile
Last active December 7, 2017 16:31
Hanging poltegeist
FROM ruby:2.4.2
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get update && apt-get install less nodejs -y
RUN npm install -g phantomjs-prebuilt
RUN gem install poltergeist
WORKDIR /app
COPY . .
ENTRYPOINT ruby test.rb
@mtsmfm
mtsmfm / README.md
Last active April 14, 2018 09:54
Docker for Mac + k8s dashboard + helm