rbenv not showing the correct ruby version

06/19/15  Public, Ruby General

If you don't see the version of ruby in the list you need when you run rbenv install --list

run:

$ brew update && brew reinstall --HEAD ruby-build

then install the ruby version, i.e. rbenv install 2.2.1

From: https://github.com/H...

1 vote - harrylevine

Array.map shortcut

05/24/15  Public, Ruby General

In Ruby code, you quite often see the trick of using an expression like:
array.map(&:method_name) as a shorthand form of
array.map { |element| element.method_name }

From: http://www.toptal.com/ruby/interview-questions

1 vote - harrylevine

Load a file into IRB from the root directory's perspective

05/24/15  Public, Command Line

  • Begin withload
  • Followed by a ~, which represents the root directory
  • followed by the file path, from the root directory, to the file in question

For example:

$ load '~/Dropbox/Coding/Sandbox/Random/bench_kill_data.rb'

1 vote - harrylevine

Git reset one file

04/08/15  Public, Git

$ git checkout HEAD -- my-file.txt

For example:

$ git checkout HEAD -- README.md

http://stackoverflow.com/questions/7147270/hard-reset-of-a-single-file

1 vote - harrylevine

V2P Imaging w/VMware, Acronis, and Sysprep

07/23/15  Public, Other Languages

The process in which we need to sysprep VM's to make a V2P image dump. This is process will work for all versions of Windows (except XP).

Required Software:
VMware http://www.vmware.com/
Acronis TrueImage http://www.acronis.com/en-us/...

1 vote - colinrubbert

RSpec Expectation Matchers

04/02/15  Public, Testing / TDD

RSpec list of available Expectation Matchers. From the Lynda.com course RSpec Testing Framework with Ruby

1 vote - harrylevine

Command line keyboard shortcuts

04/02/15  Public, Shortcuts

control + a = Move to the start of the line
control + e = Move to the end of the line
esc + f = Move forward a word
esc + b = Move backward a word
control + b = Move back one character
control + f = Move forward one character
`co...

1 vote - harrylevine

Command to access your Rails sqlite3 database from the command line

03/28/15  Public, Databases

$ sqlite3 db/development.sqlite3

Run .tables to get a list of database tables, to confirm you are in the right place

Then run .help for list of available commands

Reference site: https://www.sqlite.org/cli.html

1 vote - harrylevine

rbenv common commands

04/04/15  Public, Other Languages

From the rbenv GitHub site

rbenv versions lists all Ruby versions known to rbenv, and shows an asterisk next to the currently active version.

$ rbenv versions
  1.8.7-p352
  1.9.2-p290
*...

1 vote - harrylevine

Ideal code description

03/14/15  Public, Ruby General

In most cases, our idea of ideal code is simple, readable, maintainable, and modular.

-Exercisim.io

1 vote - harrylevine