Skip to content

Instantly share code, notes, and snippets.

View agilous's full-sized avatar

Bill Barnett agilous

View GitHub Profile
@agilous
agilous / ubuntu-packages-supporting-ruby-development.md
Last active June 25, 2020 19:57
Installing Ruby via asdf on Ubuntu Linux

Installing Ruby on Ubuntu Linux via asdf

1. Beginning with the Essentials & asdf

Run these commands in a terminal:

sudo apt-get install -y build-essential curl git linux-headers-`uname -r` wget
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.7.8
echo '. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo '. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
. ~/.bashrc
@agilous
agilous / relay_test.rb
Last active October 27, 2016 18:57
Simple TCP socket script used to test an HL7 relay app.
require 'ruby-hl7'
require 'socket'
require 'pry'
control_k = 11.chr
control_backslash = 28.chr
control_m = 13.chr
hl7 = "#{control_k}MSH|^~\&|ADM|ADMH|||201609160645|JJOHNSON|ADT^A05|597318|D|2.2|||AL|NE#{control_m}EVN|A05|201609160644|||JJOHNSON^JOHNSON^JOHNNY^M#{control_m}PID|||H000027068|||||||||||||||V00020200200#{control_m}PV1|1|P|NEPC#{control_m}PV2|||abd pain#{control_m}OBX|1|TX|ZADM.ARRIV^ARRIVAL MODE:^ADM||||||||F#{control_backslash}#{control_m}"
hl7_msg = HL7::Message.new(hl7.strip)
@agilous
agilous / flow_log_message.rb
Last active September 2, 2016 01:00
Simple Ruby class that converts Amazon Flow Log message to a hash.
class FlowLogMessage
def initialize(message)
@message = message
end
def to_hash
msg = Hash.new
msg[:version], msg[:account], msg[:interface_id], msg[:source_ip], msg[:destination_ip], msg[:source_port], msg[:destination_port], msg[:protocol], msg[:packets], msg[:bytes], msg[:window_start], msg[:window_end], msg[:action], msg[:flow_log_status] = @message.split(' ')
msg
end
@agilous
agilous / web-development-for-kids.md
Last active August 29, 2015 14:20
Web Development For Kids
@agilous
agilous / rails-3.2-to-4.0-tldr.md
Last active August 29, 2015 14:18
Ruby on Rails Upgrade TL;DR's

Rails 3.2 to 4.0 TL;DR

Thanks!

Kudos and thanks to the Rails team for producing and maintaining a high level of documentation. This TL;DR was created to speed skimming of the differences between Rails 3.2 and Rails 4.0. You are encouraged to read the complete more detailed descriptions here, especially if any items listed below appear relevant to your app.

Abbreviated Change Log

  1. The default HTTP verb is PATCH rather than PUT with a special note about JSON Patch. [[1]]
  2. The assets group has been removed from Gemfile.
  3. Support for loading plugins from vendor/plugins is removed.
  4. ActiveRecord changes include:
@agilous
agilous / heroku-response-time-parser.rb
Last active August 29, 2015 14:02
Simple Heroku log response time parser
%w(2014-06-02.log 2014-06-03.log).each do |file_name|
file = File.open(file_name, "r")
lines = 0
total_response_time = 0
file.each do |line|
response_time = line[/\b(\d{1,})ms \(/].to_i
if response_time > 0
puts "Found a response time of #{response_time} in this line: #{line}" if ARGV.size > 0
@agilous
agilous / community.md
Last active August 29, 2015 13:57
What Community Has Done For Me

What Community Has Done For Me

In the beginning...

"There's safety in numbers" as they say. As species go, Homo sapiens were not the first to figure that out. "Community" is at least a couple eons old. There's fossil evidence of communal living pre-dates the dinosaurs but I'm no paleontologist. All I can do is tell you my story.

Keybase proof

I hereby claim:

  • I am agilous on github.
  • I am agilous (https://keybase.io/agilous) on keybase.
  • I have a public key whose fingerprint is 5880 4FA6 0016 D007 944F C615 BF10 CB42 ECC5 BDB2

To claim this, I am signing this object:

@agilous
agilous / 0-candida-detox.md
Last active August 29, 2015 13:57
Candida Detox Recipes

Candida Detox

Candida is a yeast common in the human gut flora. It is also the most common cause of fungal infection worldwide. According to a recent article on MindBodyGreen, symptoms of a candida overgrowth are:

  • Skin and nail fungal infections (such as athlete’s foot or toenail fungus)
  • Feeling tired and worn down or suffering from chronic fatigue or fibromyalgia
  • Digestive issues such as bloating, constipation, or diarrhea
  • Autoimmune disease such as Hashimoto’s thyroiditis, Rheumatoid arthritis, Ulcerative colitis, Lupus, Psoriasis, Scleroderma or Multiple sclerosis
  • Difficulty concentrating, poor memory, lack of focus, ADD, ADHD and brain fog
  • Skin issues such as eczema, psoriasis, hives, and rashes
@agilous
agilous / bicycle-bicycle.md
Last active December 22, 2015 11:58
This gist is posted on the Gaslight Blog here: http://gaslight.co/blog/bicycle-bicycle

It's little secret that I've been bitten by the bicycling bug. We'd long spoken around the office about how cool it would be to just ride a bike to work whenever the odd car repair bill surfaced. However I took to the bike as last ditch effort to combat my increasing girth. Oddly, increasing exercise has always seemed a much simpler task than modifying my diet. Saving on gas and vehicle maintenance were simply ancillary benefits.

Biking is hip!

Like so many cities, Cincinnati is beginning to embrace the biking public. The recent ribbon breaking of Riverside Drive bike lane improvements had me itching to checkout a route that may well be part of my future commute. That is if Gaslight winds up moving downtown. The monthly Web/Tech Drinkup offered the perfect excuse!

Mind you, I've been biking fairly regularly for about 15 months, consisting largely of 10 mile round-trip work commute