Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View eimermusic's full-sized avatar

Martin Westin eimermusic

View GitHub Profile
@ahoward
ahoward / net-http-debug.rb
Created December 10, 2010 20:06
a simple way to debug tons of libs that use ruby's net/http
BEGIN {
require 'net/http'
Net::HTTP.module_eval do
alias_method '__initialize__', 'initialize'
def initialize(*args,&block)
__initialize__(*args, &block)
@graza
graza / savon_response_body.rb
Created December 3, 2010 19:32
Monkey patch to get Savon to handle multipart responses
module Savon
class Response
MIME_HEADER_PART = /^\s*(\w+)\s*=\s*(["']?)(.+)\2$/
def body
return @body if @body
@body = gzipped_body? ? decoded_body : @http.body
if @http['content-type'] =~ /^multipart\//i
# Parse the header to get the boundary
params = {}
@http['content-type'].split(/;/).each do |part|
// Provides a device_scale class on iOS devices for scaling user
// interface elements relative to the current zoom factor.
//
// http://37signals.com/svn/posts/2407-device-scale-user-interface-elements-in-ios-mobile-safari
// Copyright (c) 2010 37signals.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell