Skip to content

Instantly share code, notes, and snippets.

fernandoaleman /
Last active March 23, 2024 14:56
How to install mysql2 gem on m1 Mac


Installing mysql2 gem errors on Apple silicon M1, M2 or M3 Mac running macOS Sonoma.


Make sure mysql-client, openssl and zstd are installed on Mac via Homebrew.

Replace mysql-client with whichever mysql package you are using

joshdholtz / .zshrc
Created October 27, 2021 19:16
Josh's M1 Mac Development Environment - homebrew, zsh
# ~/.zshrc
export ZSH="/Users/joshholtz/.oh-my-zsh"
# joshdholtz theme shows arch type in the prompt
source $ZSH/
# M1 and Rosetta
barbolo / benchamark_hash_to_json.rb
Last active September 24, 2022 03:32
Benchmark of JSON rendering in Ruby
# gem install multi_json json yajl-ruby oj benchmark-memory
require 'multi_json'
require 'json'
require 'yajl'
require 'oj'
require 'benchmark'
require 'benchmark-memory'
hash1 = {
ufologist / mobile-hls-video.html
Last active September 21, 2023 09:01
Web 前端如何播放 HLS(.m3u8) 视频
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Mobile HLS video</title>
<h1>Mobile HLS video</h1>
evantoli /
Last active April 12, 2024 14:11
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

ryanseys / play_mp3.rb
Created April 3, 2013 03:37
Play MP3 file in terminal using Ruby
pid = fork{ exec 'afplay', "song.mp3" } # on mac osx
mikepfirrmann / pretty-exception.rb
Created October 2, 2012 16:24
Print a prettier stack trace for Ruby exceptions
def colorize(text, color_code)
# Here be dangerous things.
rescue => e
print "\r" << (' ' * 50) << "\n"
stacktrace = do |call|
if parts = call.match(/^(?<file>.+):(?<line>\d+):in `(?<code>.*)'$/)
roberto / _flash_messages.html.erb
Created August 13, 2012 22:47
Rails flash messages using Twitter Bootstrap
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
<% end %>