Skip to content

Instantly share code, notes, and snippets.

@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
class X < BasicObject
MAP = {
fizz: 3,
buzz: 5
}
def initialize(n)
@n = n
@result = nil
end
@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
@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 / a.rb
Last active July 16, 2017 11:33
class A
def hi
puts 'hi'
end
end
A.new.hi
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 / 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'
@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 / readme.md
Last active December 27, 2016 01:27
西日暮里.rb x Shinjuku.rb Extreme Fish Bowl
version: '2'
services:
web:
build: .
nginx:
image: nginx
ports:
- 8080:80
command: |