Skip to content

Instantly share code, notes, and snippets.

View lf-'s full-sized avatar
πŸ’­
GitHub πŸ’§πŸ§Š

jade lf-

πŸ’­
GitHub πŸ’§πŸ§Š
View GitHub Profile
@jhass
jhass / README.md
Last active May 7, 2024 07:11 — forked from yorkxin/README.md
Proxy to remote server with CORS support

cors.py for mitmproxy

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

Usage

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.

Run:

@ThomasR
ThomasR / qrcode-bookmarklet.js
Last active November 21, 2024 17:53
A bookmarklet that generates a QR Code of the current URL. Click to return to page content.
javascript: void (function (main) {
var script = document.createElement('script');
script.onload = main;
script.src = 'https://davidshimjs.github.io/qrcodejs/qrcode.min.js';
document.head.appendChild(script).parentNode.removeChild(script);
})(function () {
var size = 400;
var qr = new QRCode(document.body, {
text: location.href,
width: size,
@tvogel
tvogel / git-merge-associate
Created March 30, 2011 13:23
git script to manually associate files in a conflicting merge when rename detection fails
#!/bin/bash
#
# Purpose: manually associate missed renames in merge conflicts
#
# Usage: git merge-associate <our-target> <base> <theirs>
#
# Example: After a failed rename detection A/a -> B/b which results
# in CONFLICT (delete/modify) for A/a and corresponding "deleted by us"
# messages in git status, the following invocation can be used to manually
# establish the link: