Skip to content

Instantly share code, notes, and snippets.

Jonne Haß jhass

Block or report user

Report or block jhass

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jhass /
Last active Aug 21, 2019 — forked from chitsaou/
Proxy to remote server with CORS support
View for mitmproxy

Hacking CORS restriction to enable in-browser XHR to any server.


Say you are running an web app at localhost, and you want to send XHR to http://remote-server:80, but the CORS restriction forbids access because you are sending requests from an origin that remote-server:80 does not allow.


jhass / follow_all.rb
Created Nov 16, 2011
Add all followers to an aspect, edit and save under script/follow_all.rb, run with bundle exec ruby ./script/follow_all.rb
View follow_all.rb
#!/usr/bin/env ruby
user_id = 0 # your user id
aspect_name = "Work" # Name of the aspect followers should be added to
require File.join(File.dirname(File.expand_path(__FILE__)), '..', 'config', 'environment')
user = User.find(user_id)
aspect = user.aspects.where(:name => aspect_name).first
user.contacts.only_sharing.each do |contact|
user.share_with(contact.person, aspect)
You can’t perform that action at this time.