Skip to content

Instantly share code, notes, and snippets.

Avatar
❤️
Building software with love

Patrick Howard Wiseman thephw

❤️
Building software with love
View GitHub Profile
View gist:892ef5e6be307b6ed49d39b28d7484e2
# Get the digest from a tag on a remote repository
docker inspect ${IMAGE_TAG} --format '{{index .RepoDigests 0 }}'
# Get the tags from digest
docker inspect ${IMAGE_DIGEST} --format '{{index .RepoTags }}'
View icons.txt
Identifier_WidthxHeight.ext
Rectangle/
_150x84.{jpg,png}
_250x141.{jpg,png}
_500x281.{jpg,png}
_800x450.{jpg,png}
Square/
_150x150.{jpg,png}
_250x250.{jpg,png}
_500x500.{jpg,png}
View jameswhitemanifesto.txt
== Rules ==
On Infrastructure
-----------------
There is one system, not a collection of systems.
The desired state of the system should be a known quantity.
The "known quantity" must be machine parseable.
The actual state of the system must self-correct to the desired state.
The only authoritative source for the actual state of the system is the system.
The entire system must be deployable using source media and text files.
View gist:410564b9c5d2ca6ef7b800be2bedad70
### Keybase proof
I hereby claim:
* I am thephw on github.
* I am thephw (https://keybase.io/thephw) on keybase.
* I have a public key ASDcgr8YA9DMCiDr3Wd3E_YJs9U-4P60dphV9DtmgfkHAQo
To claim this, I am signing this object:
View README.md

Minikube VirtualBox on OS X Mojave Issues

Apple and Oracle can't see eye to eye on security so all the current Virtual Box Installers (5.2/6.0RC1) do not work. I actually blame oracle as they won't take simple steps to keep their software up to date and compatible, but that is neither here nor there.

Expected Results

VirtualBox will install correctly.

Actual Results

VirtualBox install will fail for all current version.

Work Around

@thephw
thephw / config_fix.rb
Last active Jul 25, 2017
Horseshit webkit_server fix
View config_fix.rb
config.after(:suite) do
webkit_server_pid = %x[ps].split("\n").select{|str| str.match /webkit_server/ }.first.to_i
if webkit_server_pid != 0
puts "webkit_server did not quit... killing webkit_server PID ##{webkit_server_pid}"
`kill -9 #{webkit_server_pid}`
end
end
View locknkey.ru
require "redis"
class LockNKey
def call(env)
req = Rack::Request.new(env)
case req.path_info
when /bootstrap/
redis = Redis.new
taken_environments = redis.get("environments").split(",").map(&:to_i)
available_environments = (1..24).to_a - taken_environments
View movie_finder.rb
movie_names = File.read('/Users/patrickwiseman/Desktop/movie_names.txt').split("\n")
movies = movie_names.map do |movie_name|
JSON.parse(Net::HTTP.get(URI("http://www.omdbapi.com/?t=#{movie_name}&y=&plot=short&r=json")))
end
movies = movies.sort_by{|m| m["imdbRating"].to_i}.reverse
File.write('/Users/patrickwiseman/Desktop/movies.json', movies.to_json)
View snippets.cson
'.source.ruby, .source.ruby.rails':
'Bang Logger':
prefix: 'bang'
body: 'Rails.logger.debug "#{\'=\'*100}\\\\n$1"'
View README.md

Relentlessly Gay™

Each method takes in a set of hue lights and an option set of other parameters for desired visual effect.

Basic setup

Optionally set export HUE_USERNAME=3N70R9-kFFVm-L2GvVOOEpXdDV6Th4yCUsdLrmcb if you know your username already. Otherwise you have to go click the sync button.

require 'hue'
require_relative "./hue_pride.rb"
You can’t perform that action at this time.