Skip to content

Instantly share code, notes, and snippets.

View metavida's full-sized avatar

Marcos Wright-Kuhns metavida

View GitHub Profile
@metavida
metavida / instructions.sh
Created October 12, 2016 15:33
compile openssl for ruby
# The following instructions allowed me to isntall a custom version of OpenSSL
# along-side any existing versions
# and then re-compile ruby using rvm so that the custom OpenSSL was used.
openssl_version='1.0.2j'
# Get openssl
cd ~root/src/
wget https://www.openssl.org/source/openssl-${openssl_version}.tar.gz
@metavida
metavida / benchmark_gsub_heredoc.rb
Created August 26, 2016 17:37
gsub in heredoc benchmark
def plain
<<-ERR
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.
ERR
end
@metavida
metavida / glass-half-empty.sh
Last active August 13, 2016 21:49
Answers to the question: Does (-1%7) resolve to -1 or 6?
$ node --version
v5.6.0
$ node -e "console.log(-1 % 7)"
-1
$ bc --version
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
$ echo "-1 % 7 "| bc
-1
@metavida
metavida / rm-with-symlinks-test.rb
Created April 14, 2016 21:52
Attempting to determine FileUtils.rm_rf behavior when symlinks are involved
@metavida
metavida / keybase.md
Created March 21, 2016 15:29
keybase.md

Keybase proof

I hereby claim:

  • I am metavida on github.
  • I am metavida (https://keybase.io/metavida) on keybase.
  • I have a public key ASCAyyfQAc_O2ixZXqcFp0VpTT3QNBG-VtgPJC_iAUh97Ao

To claim this, I am signing this object:

@metavida
metavida / ssl_cert_sha256_check.rb
Last active August 29, 2015 14:27
A script to help check SSL cert SHA1 vs SHA2 validity
#!/usr/bin/env ruby
require 'time'
if ARGV[0].to_s.empty?
puts <<-USAGE
Outputs info & warnings that try to help determine if Chrome, Firefox, or IE might display SHA1-related warnings about your the certificates for a given domain.
Usage: #{__FILE__} hostname [-v|--tabs]
Examples:
@metavida
metavida / PAINT - California Paints.tsv
Last active August 29, 2015 14:22
Paint colors for the Corpora project
We can make this file beautiful and searchable if this error is corrected: No tabs found in this TSV file in line 0.
After Dinner Mint
Aloe Can You Go?
Aloe Mist
Aloe Plant
Apple Martini
Applemint
Arboretum
Artificial Turf
Asparagus Fern
Bonsai
@metavida
metavida / federated_auth.rb
Created April 16, 2015 21:54
Haiku Federated Auth Example Script
# A simple web service that can be used to test Haiku's Federated Login system.
#
# Since there's no real data backing this authentication script, it will authorize
# any username given as long as the password matches the default_password (set below).
#
# In order to simulate "SSO via a Signed Link" this script will authorize any session_key
# given to it, removing any non-login-safe characters.
#
# Use the following commands to start this authentication service:
# gem install sinatra
@metavida
metavida / gist:f2357363776a3153ecd5
Last active August 29, 2015 14:11 — forked from JulianRamirez/gist:a76e41c2691ee00f3851
Remove pgp checks (since many folks don't have it by default) and remove silly whitespace :-)
cd /tmp
curl -o git-2.2.1.tar.gz "https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.gz"
curl -o git-2.2.1.tar.sign "https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.sign"
tar zxvf git-2.2.1.tar.gz
cd git-2.2.1
./configure
@metavida
metavida / 1_zoom_title.js
Last active December 29, 2015 06:29 — forked from anonymous/zoom_tweet.js
A WIP, 5 minute intro to programming (via JavaScript)
document.getElementById('content-main-heading')
document.getElementById('content-main-heading').style.zoom //=> "1"
document.getElementById('content-main-heading').style.zoom = 2
document.getElementById('content-main-heading').style.zoom //=> "2"
var myZoomyTitle = document.getElementById('content-main-heading')
myZoomyTitle.style.zoom //=> "2"
myZoomyTitle.style.zoom = 1
jQuery(myZoomyTitle).animate({zoom: 2})