Skip to content

Instantly share code, notes, and snippets.

@fernandoaleman
fernandoaleman / mysql2-mojave.md
Last active February 7, 2024 19:19
Install mysql2 on MacOS Mojave

For MacOS Catalina, visit Install mysql2 on MacOS Catalina

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

@swordray
swordray / game2048.rb
Last active November 27, 2021 07:47
Implement game 2048 in less than 30 lines of Ruby code
class Game2048
def initialize
@array = 4.times.map { [ nil ] * 4 }
2.times { fill }
end
def fill
i, j = rand(4), rand(4)
return fill if @array[i][j]
@array[i][j] = [2, 2, 2, 2, 4].shuffle.first
@ogrrd
ogrrd / dnsmasq OS X.md
Last active April 16, 2024 20:28
Setup dnsmasq on OS X

Never touch your local /etc/hosts file in OS X again

To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.

Requirements

Install

@nelstrom
nelstrom / vim-plugin-directories
Created June 30, 2011 11:32
An overview of what belongs in each directory of a Vim plugin.
plugin
naming convention: name_of_plugin.vim
these files are sourced for all file types
doc
naming convention: name_of_plugin.txt
these files document the functionality of a plugin
color
naming convention: name_of_colorscheme.vim