Skip to content

Instantly share code, notes, and snippets.

View chaserx's full-sized avatar
Mostly Meetings. Sometimes not.

Chase Southard chaserx

Mostly Meetings. Sometimes not.
View GitHub Profile
chaserx / Gemfile
Last active April 14, 2023 13:49 — forked from akshayvadher-BTC/sample_qr.rb
Generate QR code
View Gemfile
# frozen_string_literal: true
source ""
gem "prawn"
gem "prawn-qrcode"
gem "matrix"
View obsidian daily note template
# {{date}}
[[{{Yesterday}}|<]] | {{date}} | [[{{Tomorrow}}|>]]
## Gratitude
- I am grateful for:
- ...
## Target(s)
- [ ] Goal
chaserx / gist:6ab418638f0daabede8efc8f741a389b
Created October 27, 2019 17:13
Extract relevant info from AWS CLI with jq
View gist:6ab418638f0daabede8efc8f741a389b
aws ec2 describe-instances --profile=chaserx | jq '.Reservations[].Instances[] | { instance: .InstanceId, publicip: .PublicIpAddress, privateip: .PrivateIpAddress, publicDNS: .PublicDnsName, tags: .Tags, state: .State.Name }'
chaserx / .irbrc
Created March 9, 2019 21:38
irb + awesome_print
View .irbrc
# awesome print
require 'awesome_print'
rescue LoadError => err
warn "Couldn't load awesome_print: #{err}"
chaserx / The Ten Commandments of Egoless
Last active March 4, 2021 07:53
The Ten Commandments of Egoless Programming
View The Ten Commandments of Egoless

The Ten Commandments of Egoless Programming

  1. Understand and accept that you will make mistakes. The point is to find them early, before they make it into production. Fortunately, except for the few of us developing rocket guidance software at JPL, mistakes are rarely fatal in our industry. We can, and should, learn, laugh, and move on.

  2. You are not your code. Remember that the entire point of a review is to find problems, and problems will be found. Don’t take it personally when one is uncovered.

  3. No matter how much "karate" you know, someone else will always know more. Such an individual can teach you some new moves if you ask. Seek and accept input from others, especially when you think it’s not needed.

  4. Don’t rewrite code without consultation. There's a fine line between "fixing code" and "rewriting code." Know the difference, and pursue stylistic changes within the framework of a code review, not as a lone enforcer.

chaserx / sunday_ticket_scraper.rb
Created September 5, 2014 03:45
table to array of hashes example
View sunday_ticket_scraper.rb
#!/usr/bin/env ruby -wKU
# gems required:
# - nokogiri
# - awesome_print
# - open-uri-cached
require 'nokogiri'
require 'open-uri'
require 'awesome_print'
chaserx /
Created August 18, 2014 13:50
verifying identity

Keybase proof

I hereby claim:

  • I am chaserx on github.
  • I am chaserx ( on keybase.
  • I have a public key whose fingerprint is C680 33F7 E216 251D F7E5 C95E A91D 479C 048F 7ACA

To claim this, I am signing this object:

chaserx / downloader.rb
Created June 26, 2014 01:54
download all images from a web page via img src using nokogiri and mechanize
View downloader.rb
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'uri'
require 'mechanize'
require 'pathname'
# inspired by:
class Downloader
def make_absolute href, root
View random_hearts.pde
// Random Heart
// random hearts for you
int number = 128;
float x;
float y;
float a;
color[] palette = { color(247,162,185), color(242,100,122), color(221,38,32), color(146,2,0) };
chaserx / failed_ftp_recursive_deletes.rb
Created July 19, 2013 14:19
various failed attempts to remove non-empty folder via FTP cobbled together from example code and internal methods from various stackoverflow answers and gems.
View failed_ftp_recursive_deletes.rb
REGEX = /^(?<type>.{1})(?<mode>\S+)\s+(?<number>\d+)\s+(?<owner>\S+)\s+(?<group>\S+)\s+(?<size>\d+)\s+(?<mod_time>.{12})\s+(?<filename>.+)$/
def delete_directory_contents(path, verbose = true)
# files = @ftp_conn.nlst(path)
# files.each do |file|
# if directory?("#{path}/#{file}")
# delete_directory_contents "#{path}/#{file}"
# @ftp_conn.rmdir("#{path}/#{file}")
# else
# @ftp_conn.delete("#{path}/#{file}")
# end