Skip to content

Instantly share code, notes, and snippets.

View thewatts's full-sized avatar

Nathaniel Watts thewatts

View GitHub Profile
<h1>Hi There :wave:</h1>
Today is: <%= Date.current %>
@thewatts
thewatts / main.rb
Created July 26, 2023 03:25
Collisions w/ DragonRuby - not all getting found?
# DR 5.2
def tick(args)
enemies = [
{
name: "Dragon",
x: 110,
y: 110,
h: 25,
w: 25
@thewatts
thewatts / main.rb
Last active July 5, 2023 00:48
DR Perf
# module GTK
# class Runtime
# def __sdl_tick__ sdl_tick
# @sdl_tick = sdl_tick
# tick_argv
# return if @no_tick
# __sdl_tick__simulation__
# rescue Exception => e
# @last_tick_exception_global_at = Kernel.global_tick_count
# pretty_print_exception_and_export! e

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 December 28, 2018 21:29 — forked from fernandoaleman/mysql2-mojave.md
Install mysql2 on MacOS Mojave

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 September 4, 2018 20:40
This is a quick gist for setting up simple Virtual Hosts with MAMP

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

Keybase proof

I hereby claim:

To claim this, I am signing this object:

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 ++++++++++++++++++++++++++++"
## 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