Skip to content

Instantly share code, notes, and snippets.

View hogihung's full-sized avatar

John F. Hogarty hogihung

  • Left Foot Media, Inc.
  • Jacksonville, FL
View GitHub Profile
@hogihung
hogihung / How_To_Install_PG-Gem
Created December 22, 2014 16:28
Installing Postgres Gem - OS X / CentOS
If you receive an error message regarding the pg gem while running bundle install, try the
following solution.
[USE THIS FOR OS X]
gem install pg -v '0.17.1' -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
[USE THIS FOR CentOS]
gem install pg -v '0.17.1' -- --with-pg-config=/usr/pgsql-9.3/bin/pg_config
@hogihung
hogihung / How_To_Install_Oracle_DB-Server_CentOS
Created November 11, 2014 14:51
Installing Oracle 11G Express on CentOS 6.x
--------------------------------------------------------------------------------
Author: John F. Hogarty
Create Date: 08/12/2014 @ 05:00pm est
Modified Date: 08/15/2014 @ 08:47am est
Subject: Installing Oracle Database 11g Express for CentOS 6.x
--------------------------------------------------------------------------------
1. sudo su -
@hogihung
hogihung / How_To_Install_Oracle_Client_CentOS
Created November 11, 2014 13:05
Installing Oracle Client on CentOS, with Ruby support
[username@hostname Downloads]$ ls -l
total 67196
-rw-rw-r-- 1 username username 67349889 Aug 19 19:37 oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm
-rw-rw-r-- 1 username username 629474 Aug 19 19:37 oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm
-rw-rw-r-- 1 username username 824523 Aug 19 19:36 oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm
[username@hostname Downloads]$ sudo rpm -i oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm
[sudo] password for username:
[username@hostname Downloads]$ sudo rpm -i oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm
[username@hostname Downloads]$ sudo rpm -i oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm
[username@hostname Downloads]$ sqlplus
@hogihung
hogihung / How_to_Fix_git_Master
Created November 3, 2014 19:22
Git force Master to Reset
git fetch --all
git reset --hard origin/master
git pull origin master
@hogihung
hogihung / How_To_Enable_Networking_CentOS_65
Created August 28, 2014 20:43
Enable Networking - CentOS (VM via Parallels)
When I create a CentOS 6.5 VM on my MacBook Pro, via Paralles Desktop, the networking component was disabled by default. To turn up networking, do the following:
sudo su - # if not already root user
cd /etc/sysconfig/network-scripts/
ls
vim ifcfg-eth0
File looked like:
DEVICE=eth0
HWADDR=00:XX:XX:XX:XX:XX (use your real values here)
@hogihung
hogihung / Fix_RSpec_Testing_Issue.rb
Last active August 29, 2015 14:05
Bug Fix of one of my RSpec tests.
# I was proud of myself for figuring out to code the following for one of my rspec features.
# The test worked fine up till today. Can you see the problem?
# (the rest of the file has been omitted as it isn't necessary for this learning exercise.)
scenario 'user successfully creates a hot item' do
sign_in
create_valid_hot_item
end
def create_valid_hot_item
@hogihung
hogihung / How_To_Install-OCI-Gem_OSXMavericks
Created August 15, 2014 13:09
Install Ruby OCI Gem - OSX Mavericks
NOTE: This step to be performed after you have installed the Oracle Instant Client for Mac OSX.
cd /usr/local/oracle/product/instantclient_64/11.2.0.4.0/lib/
ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln -s libocci.dylib.11.1 libocci.dylib
gem install ruby-oci8
@hogihung
hogihung / How_To_Install-OracleClient-OSX_Maverics
Last active July 28, 2016 08:48
Oracle Instant Client Setup - OS X Mavericks
NOTE: The following steps were performed based on knowledge gained
from the resource -> http://blog.codiez.co.za/2013/09/setup-oracle-instant-client-ruby-oci8-gem-mac/
Download the required files from the Oracle Download site:
http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html
instantclient-basic-macos.x64-11.2.0.4.0.zip
instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
instantclient-sdk-macos.x64-11.2.0.4.0.zip
@hogihung
hogihung / How-To_HIRB
Created July 31, 2014 16:12
Configure Hirb in Rails App
Add and Enable for our rails apps:
app_name/Gemfile
gem 'hirb'
app_name/config/environment.rb
require 'hirb'
Hirb::View.enable
*** Note: If you are using the pry gem, you may need to adjust your settings. I don't think you need to update the config/environment.rb file. But you may need to create a .pryrc file with some settings for Hirb.
@hogihung
hogihung / How_To_Create_Rails_App
Last active August 29, 2015 14:04
Base - Creating a fresh Rails Application with Ruby 2.1.2, Rails 4.1.4, RSpec and Capybara
1. rails new [app_name] --skip-test-unit
2. cd [app_name]
3. Edit the file: Gemfile to be as follows:
source 'https://rubygems.org'
ruby '2.1.2'
gem 'rails', '4.1.4'