Skip to content

Instantly share code, notes, and snippets.

View Altons's full-sized avatar

Alberto Negron Altons

View GitHub Profile
@Altons
Altons / ActiveRecord Cheat Sheet v1
Created August 14, 2018 10:43 — forked from jessieay/ActiveRecord Cheat Sheet v1
Active Record cheat sheet with examples of queries I've needed most so far
ActiveRecord cheat sheet / EXAMPLES
INSTALL
=======
$ gem install activerecord
in GEMFILE: gem ‘activerecord’
REQUIRE
=======
require ‘active_record’
@Altons
Altons / install_ruby_rpi.sh
Created July 22, 2018 21:13 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.5 on the Raspberry Pi (Raspbian)
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby 2.5 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Welcome message
@Altons
Altons / homebrew.md
Created June 11, 2018 16:47 — forked from indiesquidge/homebrew.md
How to and Best of Homebrew

Homebrew

How To

Homebrew is a package management system for OS X. You can read more about it here, or simply run

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

to install it.

@Altons
Altons / .bash_profile
Last active August 29, 2015 14:27 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@Altons
Altons / Vagrantfile
Last active August 29, 2015 14:13
Ubuntu Rails
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
@Altons
Altons / sublime-builds
Created July 2, 2014 14:58
Sublime Builds for rbenv and python anaconda
# Ruby using rbenv
{ "cmd": ["/Users/altons/.rbenv/shims/ruby", "$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.ruby"
}
# Anaconda
{
"cmd": ["/Users/altons/anaconda/envs/py33/bin/python3", "-u", "$file"]
# Basic Twitter Analysis
# analyze and compare tweets for a defined set of hash and @ tags
# base code from "Data Science with R", a book for an introductory course from Syracuse, as per http://blog.revolutionanalytics.com/2013/02/free-e-book-on-data-science-with-r.html
# load the required packages:
require("bitops")
require("RCurl")
require("RJSONIO")
require("twitteR")
require("ROAuth")

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Ensure system is in ship-shape.

aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM