Skip to content

Instantly share code, notes, and snippets.

# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Returns the result of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111
@elle
elle / modules.md
Created August 21, 2017 06:18 — forked from JoshCheek/modules.md
Modules (lesson from 29 July 2015) covers object model, namespaces, mixins, and functions.

Modules

To understand modules, we first have to understand a little bit about how Ruby works. So, lets define the things that exist in Ruby and see how they work together. Then, we will be able to understand how modules fit into this, and what they are here for.

Definitions

@elle
elle / vim cheatsheet.md
Created August 19, 2017 11:11 — forked from jessedearing/vim cheatsheet.md
Vim Cheatsheet

#Vim Cheat Sheet

  • gqip - Reformats paragraph to textwidth
  • gq - Reformats selection
  • :Tab /= - Equally spaces based on the = symbol (requires Tabular vim plugin)
  • :setf language - Changes current language
  • :set language=language - Changes current language
  • <C-a> - Increments the number under the cursor
  • <C-x> - Decrements the number under the cursor
  • ~ - Toggles case and moves to next character in normal mode
@elle
elle / gist:4710618
Last active December 12, 2015 03:58 — forked from anonymous/gist:4705398
# Minitest examples
# wishful
describe Person do
describe 'indirect' do
subject { Person.new({pet: true}) }
it { must_be :pet? }
end
end