Skip to content

Instantly share code, notes, and snippets.

View askegg's full-sized avatar

Andrew Skegg askegg

View GitHub Profile
@askegg
askegg / cores.rb
Last active February 26, 2024 00:36
# This was a thought experiment resulting from the Rooftop Ruby podcast.
# The challenge is to distribute a number of test jobs evenly across X number of CPU cores.
# This seems to be a NP-Hard problem.
# However according to my tests you can get each job queue with 0.5% other using a simple algorithm.
#
# https://www.rooftopruby.com/2108545/14453859-35-kind-of-cool-and-interesting
test_times = Array.new(100) { rand(5..180) }
num_cores = 8
@askegg
askegg / ruby 3.3.1.md
Last active April 28, 2024 21:15
Installing Ruby 3.3 with YJIT on Macbook with ASDF

Installing Ruby 3.3.1 with YJIT on Macbook with ASDF

Install ASDF

Ensure you have homebrew installed. See https://brew.sh

brew install coreutils curl git libyaml asdf

Add the ZSH plugin

@askegg
askegg / lib\tasks\jumpstart.rake
Last active February 10, 2024 22:24
rake jumpstart
# frozen_string_literal: true
namespace :jumpstart do
desc "Maintain Jumpstart Pro"
require "fileutils"
include FileUtils
# path to your application root.
app_root = File.expand_path("../..", __dir__)