Skip to content

Instantly share code, notes, and snippets.

hunting for code to clean up

M. Scott Ford mscottford

hunting for code to clean up
View GitHub Profile
gwpantazes / How to Install JDK MacOS
Last active May 13, 2021
How to install different JDK versions on MacOS with Homebrew
View How to Install JDK MacOS

How To Install Different JDK Versions on MacOS with Homebrew

Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version

This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.

Table of Contents

rskelley9 /
Last active Feb 8, 2021
Workaround: Connect your Chromecast to a Hotel Wireless Network


I recently relocated for new employment. I've been staying in an extended stay hotel for about 3 weeks now. The hotel I'm staying in gives its guests free Wifi access. However, it requires users to accept terms and conditions on a splash page via browser interface before they can use the network. This makes it difficult to use my Chromecast with the network, as it doesn't have a means of accessing that splash page. While I could call the IT help line, I decided to explore a work-around.

Like many networks, my hotel's network attempts to improve security by using MAC address filtering. Luckily, Mac OS X (10.4 - 10.10) makes it very easy to spoof your network card's MAC address.

Here's how to add a devices like Chromecast, AppleTV, Roku to a wireless network that requires a browser to authenticate and accept terms and conditions.

Before You Start

luciomartinez /
Last active Mar 15, 2021
Add or Remove trailing slash in bash
### Add trailing slash if needed
[[ $last_char != "/" ]] && STR="$STR/"; :
echo "$STR" # => /i/am/a/path/
afn / gist:c04ccfe71d648763b306
Created Jun 12, 2014
Restart phantomjs when it hangs
View gist:c04ccfe71d648763b306
# Borrowed from
RSpec.configure do |config|
config.around(:each, type: :feature) do |ex|
example = RSpec.current_example
example.instance_variable_set('@exception', nil)
self.instance_variable_set('@__memoized', nil) # clear let variables
brandonb927 /
Last active May 9, 2021
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see
# Alot of these configs have been taken from the various places
# on the web, most from here
bokmann / ActiveRepository.rb
Created Mar 27, 2012
ActiveRepository Strawman
View ActiveRepository.rb
# MOTIVATION: As rails apps are growing, people are noticing the drawbacks
# of the ActiveRecord pattern. Several apps I have seen, and several
# developers I have spoken to are looking towards other patterns for object
# persistence. The major drawback with ActiveRecord is that the notion
# of the domain object is conflated with what it means to store/retrieve
# it in any given format (like sql, json, key/value, etc).
# This is an attempt to codify the Repository pattern in a way that would
# feel comfortable to beginner and seasoned Ruby developers alike.
saturnflyer / gist:1351998
Created Nov 9, 2011
simple load path handling
View gist:1351998
def needs(short_path)
full_path = File.expand_path(__FILE__ + '../../../' + short_path)
unless $:.include?(full_path)
$: << full_path
# Example use:
# needs('app/models')
# require 'my_model'
derEremit /
Created Nov 8, 2011 — forked from anonymous/
Generates gource video out of multiple repositories.
#!/usr/bin/env bash
# Generates gource video (h.264) out of multiple repositories.
# Pass the repositories in command line arguments.
# Example:
# <> /path/to/repo1 /path/to/repo2
jnx /
Created Oct 1, 2011
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git:// /usr/local/rbenv
# Add rbenv to the path: