Skip to content

Instantly share code, notes, and snippets.

@brenttheisen
brenttheisen / rack.rb
Created September 23, 2011 06:07 — forked from mironov/rack.rb
Fix for Rack requests showing up on ports 81 and 444 for apps hosted on a EngineYard AppCloud cluster
module Rack
class Request
def scheme
if @env['HTTPS'] == 'on'
'https'
elsif @env['HTTP_X_FORWARDED_SSL'] == 'on'
'https'
elsif @env['HTTP_X_FORWARDED_PROTO']
@env['HTTP_X_FORWARDED_PROTO'].split(',')[0]
else
@brenttheisen
brenttheisen / subdomain.js
Created May 16, 2011 15:26 — forked from benvinegar/subdomain.js
Subdomain tunneling with jQuery and document.domain
/**
* Replace $.ajax on your subdomain with a copy taken
* from your base domain. All jQuery AJAX actions go
* through $.ajax (i.e. $.get, $.post), so it's all good.
*/
(function() {
var iframe,
onload,
queue = [],