Skip to content

Instantly share code, notes, and snippets.

View klappradla's full-sized avatar

Max Mulatz klappradla

View GitHub Profile
@klappradla
klappradla / brew_spring_cleanup.sh
Created August 10, 2016 22:03
Homebrew spring cleanup
# check if a formula is still needed
brew uses —installed formula
@klappradla
klappradla / debugging_in_jruby.md
Last active March 22, 2024 12:10
Debugging in JRuby

Debugging in JRuby

Step-by-step debugging and stack navigation for JRuby code.

Problem: the common tools byebug and pry-byebug are MRI-only.

Prerequisites

Force JRuby to run in fully interpreted mode:
(otherwise next would behave like step)

@klappradla
klappradla / homebrew_fix_updates.sh
Created September 20, 2016 16:47
Reset Homebrew if updates are no longer working
cd `brew --prefix`
git fetch origin
git reset --hard origin/master
@klappradla
klappradla / procs_vs_lambdas.md
Last active October 21, 2016 21:27
Procs vs. Lambdas (example)

Procs vs. Lambdas

Seem the same:

[1] pry(main)> pr = proc { p "Hi" }
=> #<Proc:0x007fdc7a1398f0@(pry):8>
[2] pry(main)> lam = -> { p "Hi" }
=> #<Proc:0x007fdc79c53110@(pry):9 (lambda)>
[3] pry(main)> pr.class
@klappradla
klappradla / validation_example.rb
Created August 6, 2017 12:00
Single file rails app to illustrate acceptance only validations
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
@klappradla
klappradla / downgrade_tmux.md
Last active June 17, 2022 07:40
Downgrade homebrew's tmux to 2.9a

Downgrade tmux installed via homebrew to v 29.a.

Uninstall current version and install from the old formula:

brew uninstall tmux
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/c8cff106b17b90472cc6e251b9e5c2daf4fd8d46/Formula/tmux.rb

Pin the version to prevent it from accidental upgrades:

@klappradla
klappradla / np_example.sh
Created May 14, 2020 22:38
Minimal example to explore custom versions problem with np
#!/bin/sh
set -o errexit
set -o nounset
# Create directory
mkdir example && cd example
# Initialize Git repository
git init && git commit --allow-empty -m "init commit"