Skip to content

Instantly share code, notes, and snippets.


John Morales JohnMorales

  • Northern Virginia
View GitHub Profile
View gist:a04a73057f79737ae256b58236f22600
# install build dependencies
sudo yum install -y git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel
# clone and install rbenv environment
cd ~
git clone git:// .rbenv
git clone git:// ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
JohnMorales /
Created Mar 30, 2017 — forked from jpfuentes2/
CentOS: rbenv install and system wide install
# CentOS rbenv system wide installation script
# Forked from
# Installs rbenv system wide on CentOS 5/6, also allows single user installs.
# Install pre-requirements
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel \
make bzip2 autoconf automake libtool bison iconv-devel git-core
JohnMorales /
Last active Aug 29, 2015 — forked from XVilka/
True Color (16 million colors) support in various terminal applications and terminals

Colors in terminal

It's a common confusion about terminal colors... Actually we have this:

  • plain ascii
  • ansi escape codes (16 color codes with bold/italic and background)
  • 256 color palette (216 colors + 16 gray + ansi) (colors are 24bit)
  • 24bit true color ("888" colors (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
View gist:73e1280c962604e48273
package main
import (
func main() {
count := 0
View tmux-24.diff
This diff is a modified version of a diff written by Arnis Lapsa.
[ The original can be found here: ]
This diff adds support to tmux for 24-bit color CSI SRG sequences. This
allows terminal based programs that take advantage of it (e.g., vim or
emacs with patch)
to display 16 million colors while running in tmux.
The primary change I made was to support ":" as a delimeter as well

#ActiveRecord cheat sheet / EXAMPLES


$ gem install activerecord

in GEMFILE: gem ‘activerecord’


View zlorpian
Good afternoon fellow space travelers, thanks for coming along on this mission. We still have about a week
before we arrive at New Zlorpia, so please return your stasis tubes to their original upright position and
prepare for your mission briefing.
We are going to be negotiating a trade agreement with the Zlorpians for their supply of Farkle seeds. They
have a much different way of counting than we do, and I'm concerned that if we don't have a good way to
work with their number system, we'll be at a disadvantage in negotiations. Let me explain:
The zlorpians have a single arm that comes out of their forehead, with a hand that has 3 fingers. As a
result, our base-10 way of counting (based on our ten fingers) is as alien to them as their way is to us.