$ rails plugin new forget --mountable --skip-test-unit --dummy-path=spec/dummy
$ git init
$ git add .
$ git commit -m "Initial commit - generate a Rails Engine called Forget"
<!-- Begin Student --> | |
<li class="home-blog-post"> | |
<div class="blog-thumb"> | |
<a href="students/student_name.html"> | |
<img width="304" height="304" class="prof-image" src="img/students/Caplan_headshot.png" class="attachment-blog-thumb wp-post-image" alt="student_name"> | |
</a> | |
</div> | |
<div class="blog-title"> | |
<div class="big-comment"> |
require 'benchmark' | |
class Collatz | |
@@collatzes = {1 => 1} | |
def self.max_chain_starter_under(highest) | |
(1...highest).max_by { |option| Collatz.new(option).length } | |
end | |
def initialize(num) |
# Assumes all your submodules are accessed via SSH, not HTTPS | |
template = <<-TEMPLATE | |
[submodule "%{submodule}"] | |
path = vim/.vim.symlink/bundle/%{submodule} | |
url = %{submodule_url} | |
ignore = dirty | |
TEMPLATE | |
puts Dir.foreach('.').reject { |i| %w(. .. script.rb).include? i }.map { |dir| |
# Instructions | |
# | |
# 1. Backup your repo somewhere! | |
# 2. Make sure `git stash list` is empty - that'll help debugging in case things go wrong. | |
# 3. Make sure `git status` shows that you've made no changes; that'll break things right away. | |
# 4. Copy and paste the code below. | |
# 5. Run the `update_timestamps` function and LET IT FINISH! | |
# 6. Check the results, make sure they look reasonable, and commit! | |
# | |
# P.S. I take no responsibility for your use of the script; I recommend understanding what it does before running it. |
I hereby claim:
To claim this, I am signing this object:
require 'get_process_mem' | |
require 'curses' | |
initial_map = <<~MAP | |
............................ | |
............................ | |
.....O......O......O......O. | |
......O......O......O......O | |
....OOO....OOO....OOO....OOO | |
............................ |
Warming up -------------------------------------- | |
Array#unshift 1.000 i/100ms | |
Array#push 16.000 i/100ms | |
Calculating ------------------------------------- | |
Array#unshift 0.428 (± 0.0%) i/s - 3.000 in 7.014513s | |
Array#push 178.573 (± 9.0%) i/s - 896.000 in 5.064291s | |
Comparison: | |
Array#push: 178.6 i/s | |
Array#unshift: 0.4 i/s - 417.41x (± 0.00) slower |