Skip to content

Instantly share code, notes, and snippets.

View metavida's full-sized avatar

Marcos Wright-Kuhns metavida

View GitHub Profile
#!/bin/sh
=begin 2>/dev/null
exec ${RUBY_BIN:-ruby} -e"\$0='$0'; load '$0'" -- $@
=end
#!/usr/bin/env ruby
puts 123
# Examples:
#
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@mattheworiordan
mattheworiordan / application.rb
Last active October 24, 2017 06:41
Cloudflare Middleware for Rails
# insert within your Application
config.middleware.insert_before(0, Rack::CloudFlareFixup)