Skip to content

Instantly share code, notes, and snippets.

View makimoto's full-sized avatar
😪

Shimpei Makimoto makimoto

😪
View GitHub Profile

Keybase proof

I hereby claim:

  • I am makimoto on github.
  • I am makimoto (https://keybase.io/makimoto) on keybase.
  • I have a public key ASB9yD6QsXwfTx6UY0TwXmJ_IpUgkKmp_bHuuDQTnKx7eQo

To claim this, I am signing this object:

# extract_5chars.rb
# extract effective 5-character words for the initial word of Wordle.
#
# Written by: Shimpei Makimoto
# License: MIT License https://makimoto.mit-license.org/
#
# usage: ruby extract_5chars.rb <input_file>
# The input_file is a list of words that are separated by newline.
# such as: https://github.com/tabatkins/wordle-list/blob/main/words
# https://dumps.wikimedia.org/enwiktionary/
[bundler|tags/v1.16.1]% stackprof out.dump --limit 100
==================================
Mode: cpu(1000)
Samples: 21403 (6.89% miss rate)
GC: 2649 (12.38%)
==================================
TOTAL (pct) SAMPLES (pct) FRAME
5838 (27.3%) 5838 (27.3%) Gem::Package#realpath
2649 (12.4%) 2649 (12.4%) (garbage collection)
11253 (52.6%) 1873 (8.8%) Gem::Package#extract_tar_gz
require 'stackprof'
require 'tmpdir'
$LOAD_PATH.unshift('./lib')
require 'bundler'
StackProf.run(mode: :cpu, raw: true, out: 'out.dump') do
bundler_gemspec = Gem::Specification.load(File.expand_path("./bundler.gemspec"))
bundler_gemspec.instance_variable_set(:@full_gem_path, File.expand_path("."))
bundler_gemspec.activate if bundler_gemspec.respond_to?(:activate)
1.times do
#! /bin/sh
open https://www.tumblr.com/search/gif+`ruby -r uri -e "print URI.escape '$@'"`
def rot13(str)
str.tr("a-zA-Z", "n-za-mN-ZA-M")
end
ARGF.each do |line|
puts rot13(line)
end
@makimoto
makimoto / log.txt
Created April 16, 2014 13:11
ruby/www.ruby-lang.org failure log
Using worker: worker-linux-5-1.bb.travis-ci.org:travis-linux-10
Applying updates
travis_fold:start:git.1
$ git clone --depth=50 --branch=master git://github.com/ruby/www.ruby-lang.org.git ruby/www.ruby-lang.org
Cloning into 'ruby/www.ruby-lang.org'...
remote: Counting objects: 3196, done.
remote: Compressing objects: 0% (1/2145) 
remote: Compressing objects: 1% (22/2145) 
remote: Compressing objects: 2% (43/2145) 
➜ ~ pry -rripper
[1] pry(main)> Ripper.sexp("a")
=> [:program, [[:vcall, [:@ident, "a", [1, 0]]]]]
[2] pry(main)> Ripper.sexp("b = 1")
=> [:program,
[[:assign, [:var_field, [:@ident, "b", [1, 0]]], [:@int, "1", [1, 4]]]]]
[3] pry(main)> Ripper.sexp("c ||= 1")
=> [:program,
[[:opassign,
[:var_field, [:@ident, "c", [1, 0]]],