Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathaniel Watts thewatts

  • Conway, AR
View GitHub Profile
View homebrew_multiple_mysql_versions.md

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version
brew install mysql
@thewatts
thewatts / mysql2-mojave.md
Created Dec 28, 2018 — forked from fernandoaleman/mysql2-mojave.md
Install mysql2 on MacOS Mojave
View mysql2-mojave.md

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
@thewatts
thewatts / mamp-virtualhosts.md
Last active Sep 4, 2018
This is a quick gist for setting up simple Virtual Hosts with MAMP
View mamp-virtualhosts.md

Setting Up MAMP to have Virtual Hosts.

  • This will work with MAMP 2.1.1 on OSX Mountain Lion, no guarantee otherwise.
  • Virtual Hosts allow you to use readable URLs in your address bar to point to your local web projects instead of having to type "localhost:8888", etc.

Setting Up Mamp Application

  1. Install MAMP mamp.info
  2. Launch Mamp & click on Preferences
  3. Click the Ports tab and click the Set to default Apache and MySQL ports button.
  • This will set your Apache Port to 80 and your MySQL Port to 3306
  1. Click the Apache tab to setup your Document Root
View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

View elemental.rb
require "net/http"
require "uri"
require "active_support"
require "active_support/hash_with_indifferent_access"
event_data = ActiveSupport::JSON.decode(json).deep_symbolize_keys
input_uri = event_data[:inputs].first[:uri]
filename = input_uri.split("/").last
puts "+++++++++++++++++++++++++++++ RUNNING SCRIPT ++++++++++++++++++++++++++++"
View gist:c932f1b2912208af4559d404fcbdd2bb
## ADDED.
require 'net/http'
## What they gave me.
# Get the job-related command line arguments. FOR DEMO
params = Hash.new
if ARGV[0].is_int?
jobId = ARGV.shift
input = ARGV.shift
View fg_find_or_create.rb
module FactoryGirl::Syntax::Methods
def find_or_create(name, attributes = {}, &block)
factory = FactoryGirl.factory_by_name(name)
klass = factory.build_class
factory_attributes = FactoryGirl.attributes_for(name)
attributes = factory_attributes.merge(attributes)
result = klass.find_by(attributes, &block)
View gem_make.out
/Users/watts/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
/Users/watts/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
/Users/watts/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
/Users/watts/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
/Users/watts/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
/Users/watts/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)
/Users/watts/.rvm/rubies/ruby-2.1.0/bin/ruby extconf.rb
View testing.rb
class Person
attr_reader :name
def initialize(name)
@name = name
end
def shout_name
@name.upcase
end
You can’t perform that action at this time.