Skip to content

Instantly share code, notes, and snippets.

@delneet
delneet / mac_m1_ruby_2.7.6.md
Last active October 24, 2022 13:01
Install ruby 2.7.6 on a (early) Mac M1 with apple silicon chip

After lots of trial and error, I finally got ruby 2.7.6 installed on my early mac m1 (macOS 12.6).

There are many blog posts out there suggesting different flags, ignoring warnings etc. But in the end, this is what worked for me.

DO NOT use the brew / ibrew setup, where ibrew is aliased to arch -x86_64 /usr/local/bin/brew. It will mess up your system with conflicting packages and paths.

Use a terminal without Rosetta 2.

@delneet
delneet / bundle_install.md
Last active February 15, 2022 13:58
Bundle install options for failing gems with native extenstions

Postgress

brew install libpq
gem install pg -- --with-pg-config=$(brew --prefix libpq)/bin/pg_config

Mysql2

Replace mysql version with installed version.

gem install mysql2 -- --with-ldflags=-L$(brew --prefix mysql@5.7)/lib --with-cppflags=-I$(brew --prefix mysql@5.7)/include
@delneet
delneet / github-md-cheat-sheet.md
Created April 30, 2020 14:23
Github markdown cheat sheet

keyboard keys: key

colors: #ff0099

Summary with folding details Secret details
code
@delneet
delneet / process_using_port.sh
Created September 1, 2016 13:25
Find process running on port
lsof -i tcp:3000
@delneet
delneet / osx_libv8_native.sh
Created August 15, 2016 13:55
OSX libv8 with native extensions caused by therubyracer
gem uninstall libv8
gem install therubyracer
gem install libv8 -- --with-system-v8
@delneet
delneet / string_colorize.rb
Created August 25, 2015 08:50
Colorize strings
class String
def black; "\e[30m#{self}\e[0m" end
def red; "\e[31m#{self}\e[0m" end
def green; "\e[32m#{self}\e[0m" end
def brown; "\e[33m#{self}\e[0m" end
def blue; "\e[34m#{self}\e[0m" end
def magenta; "\e[35m#{self}\e[0m" end
def cyan; "\e[36m#{self}\e[0m" end
def gray; "\e[37m#{self}\e[0m" end