Skip to content

Instantly share code, notes, and snippets.

View marcelmorgan's full-sized avatar
💭
Running

Marcel Morgan marcelmorgan

💭
Running
View GitHub Profile
@marcelmorgan
marcelmorgan / array_of_constants.rb
Last active January 4, 2016 20:49
Array of CONSTANTS
# Lets say we need to have a list of all our states
# we could do it like this
ON = 'on'
OFF = 'off'
CLOSED = 'closed'
STATES = [ON, OFF, CLOSED]
# but adding a new state means adding it in 2 places
#!/usr/bin/env ruby
# place in .git/hooks/prepare-commit-msg
branch_name = `git rev-parse --abbrev-ref HEAD`
commit_file = ARGV.first
first_line = File.open(commit_file, &:readline)
if first_line.strip.empty? && (match = branch_name.match(/(^.*\d+)/i))
@marcelmorgan
marcelmorgan / oracle-osx-installer.sh
Created December 5, 2014 20:12
Oracle Mac OS X Installer (sqlplus + SDK)
#!/bin/sh
set -e
INSTALLATION_SOURCE=instantclient_11_2
ORACLE_CLIENT_VERSION=11.2.0.4.0
ORACLE_INSTACLIENT_BASE=/usr/local/Oracle/product/instantclient
ORACLE_INSTALL_HOME=$ORACLE_INSTACLIENT_BASE/$ORACLE_CLIENT_VERSION
echo "Extracting..."