Skip to content

Instantly share code, notes, and snippets.

View metavida's full-sized avatar

Marcos Wright-Kuhns metavida

View GitHub Profile
@metavida
metavida / after_cd_hitch
Last active December 11, 2015 22:18
A handy rvm hook so that hitch automatically loads whenever you cd into an rvm project directory.
#!/usr/bin/env bash
# Add this file to your ~/.rvm/hooks/ directory to auto-initiate hitch
# whenever you cd into a project where the hitch gem is installed in the current rvm gemset.
if [[ -r ./.rvmrc && -n $(which hitch) && -x $(which hitch) ]]; then
echo 'Starting hitch'
hitch
fi
@metavida
metavida / sync_phase1_part1.diagram
Last active December 16, 2015 22:59
Sequence diagrams describing possible data synchronization methods. You can visualize these using http://www.websequencediagrams.com
# Syncronization Sequence (Phase 1)
User->App: Open & Login
App->Server: GET ToDos
Server->App: 200 OK\n{title:eat breakfast, updated:02:00}
Web->Server: Update ToDo #1 via web at 02:30\n{title:eat lunch}
User->App: Update ToDo #1 in app at 03:00
App->Server: PUT update ToDo #1\n{title:eat dinner}
note over Server
The web changes are overwritten
@metavida
metavida / embed_the_web.html
Last active December 17, 2015 23:19
Sample HTML code that a teacher might paste into a Haiku Learning Embed the Web™ block, and an example of the contents of the JS file, which will pass the login of the current user on to the widget.php page.
<script type="text/javascript" src="https://your.domainna.me/path/to/widget.js">
@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})
@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 / 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 / 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 / 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 / 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 / rm-with-symlinks-test.rb
Created April 14, 2016 21:52
Attempting to determine FileUtils.rm_rf behavior when symlinks are involved