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
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
@thewatts
thewatts / slack_watcher.scpt
Created Nov 20, 2015 — forked from benkuhn/slack_watcher.scpt
Pop up a notification prompting you to close Slack if it's open
View slack_watcher.scpt
tell application "System Events"
set activeApp to name of first process whose frontmost is true
end tell
if application "Slack" is running and activeApp is not equal to "Slack" then
tell application "Notifications Scripting"
# set show event handler results to true
set event handlers script path to (path to me)
display notification "Slack is running" message "Are you waiting on an @mention?" action button "No" other button "Yes"
View adam_roles.rb
require_relative "roles/config"
module Adam
class Roles
end
end
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 blair.php
<?php if ( ! defined('EXT') ) exit('Invalid file request');
/** FINAL
* LDAP Authentication
*
* ### EE 2.1 version ###
*
* Based on: NCE LDAP
* http://code.google.com/p/ee-ldap-extension/
* License: "if you've used this module and found that it needed something then please hand it back so that it can be shared with the world"
* Site: http://code.google.com/p/ee-ldap-extension/wiki/Introduction
View tm2iterm.rb
#!/usr/bin/env ruby
#
# This script is an astonishing feat of top notch
# rockstar craftsmanship. It totally uses artificial
# intelligence to extract colors out of tmTheme and
# build an itermcolors scheme file for iTerm2.
#
# I know this sounds crazy, but it actually knows
# approximately what colors should be used in the
# ANSI list, and tries to find nearest colors from
You can’t perform that action at this time.