Skip to content

Instantly share code, notes, and snippets.

View n3bulous's full-sized avatar

Kevin McFadden n3bulous

View GitHub Profile
@jjb
jjb / file.md
Last active March 30, 2026 20:38
Using Jemalloc 5 with Ruby.md

For years, people have been using jemalloc with ruby. There were various benchmarks and discussions. Legend had it that Jemalloc 5 didn't work as well as Jemalloc 3.

Then, one day, hope appeared on the horizon. @wjordan offered a config for Jemalloc 5.

Ubuntu/Debian

FROM ruby:3.1.2-bullseye
RUN apt-get update ; \
@natematykiewicz
natematykiewicz / migrate-sidekiq-redis.rb
Last active February 21, 2024 17:18
Migrate Sidekiq Redis
# A script to migrate Sidekiq's redis to a new server.
# This obviously can work for any redis, but I only handled
# data types that Sidekiq uses.
require 'redis'
old_redis = Redis.new url: 'redis://old-redis:6379'
new_redis = Redis.new url: 'redis://new-redis:6379'
unknowns = []
@palkan
palkan / README.md
Created January 24, 2022 13:29
Rails boot time profiling

Add the following to application.rb:

$icallbacks = []
$icallbacks.define_singleton_method(:print) do
  puts sort_by { |(a, b)| -b }.map { |(a, b)| "#{b}\t\t#{a}" }.join("\n")
end

ActiveSupport::Notifications.subscribe("load_config_initializer.railties") do |event|
 $icallbacks << [event.payload[:initializer], event.duration]
@IwoHerka
IwoHerka / naming_guidelines.md
Last active August 11, 2025 20:08
Naming Guidelines

Naming guidelines

1. Syntax

1.1 Be consistent

Consistency in naming makes reading and memory retrieval much, much easier. Conversely, changing rules and mixing conventions are very confusing and significantly increase cognitive load. Follow language, company, and project conventions for names, even if you don't like them.

1.2 Follow conventions

@aussielunix
aussielunix / Day0.md
Last active July 29, 2023 21:32
Runsheet for bootstrapping a clean MacOS M1 using https://github.com/geerlingguy/mac-dev-playbook

Day 0 - Bootstrap MacOS with Ansible

After factory resetting the maching you will need to do the following things to bootstrap it with Ansible.

  • Set default shell to bash chsh -s /bin/bash (optional)
  • Open the App Store and sign in (but do not install anything)
  • Install command line tools
    • xcode-select --install
  • Add Python 3.8 to the $PATH
  • export PATH="$HOME/Library/Python/3.8/bin:$PATH"
@ttilberg
ttilberg / readme.md
Last active February 24, 2026 22:59
My MiniTest + VCR `with_vcr {}` selective recording configuration

Minitest Recordable

This small module sets up VCR in a way that makes using VCR in Minitest a breeze. You can wrap specific parts of your test in a with_vcr block that will automatically create and name a cassette and directory based on the test and class name, and handles nested names. It works great both from inside Rails, and not.

The example test file in this gist stores its results to test/vcr/Search_GoogleTest/test_search.yml.

@tekin
tekin / .gitattributes
Last active March 31, 2026 13:50
An example .gitattributes file that will configure custom hunk header patterns for some common languages and file formats. See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details.
# Stick this in your home directory and point your Global Git config at it by running:
#
# $ git config --global core.attributesfile ~/.gitattributes
#
# See https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more for more details
*.c diff=cpp
*.h diff=cpp
*.c++ diff=cpp
*.h++ diff=cpp
@bxparks
bxparks / parseflags.sh
Last active February 21, 2024 12:07
Simple Bash Shell Command Line Processing Template
#!/bin/bash
#
# Self-contained command line processing in bash that supports the
# minimal, lowest common denominator compatibility of flag parsing.
# -u: undefined variables is an error
# -e: exit shell on error
set -eu
function usage() {
@kayintveen
kayintveen / README.md
Last active March 26, 2022 08:45
Local Magento2 Development on Mac OS X Catalina and Mojave. Solving FD_SETSIZE Max processes and Max file descriptior issues.

Local Magento2 development on Mac OS X Catalina

Added the document to Medium and expanded it a bit with more configuration examples:

https://medium.com/@k.veen/setup-a-local-php-development-environment-on-mac-catalina-for-laravel-and-magento-2-development-3d7f1c587d86

After a lot of headace and sturggle i went back to what i trust. no more Laravelt Valet or Valet-plus or any other wrappers and workarounds. Sure a few things like enabling and disabling Xdebug is a tad bit more work. but its matter of seconds.

@chiranthsiddappa
chiranthsiddappa / list_all_software_bash.sh
Last active August 1, 2019 22:15
List development packages being used on Ubuntu
#!/bin/bash
source ~/.bash_profile
if hash sdk 2>/dev/null; then
sdk current
echo "Gradle cache:"
pushd ~/.gradle/caches && tree | grep '.jar' | grep -v 'sources' | rev | cut -d' ' -f1 | rev | sed 's/[-_][0-9].*//' | sort| uniq
popd
fi
if hash python2 2>/dev/null; then