This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.web | |
class Handler(tornado.web.RequestHandler): | |
def error(self): | |
self.set_header("Access-Control-Allow-Credentials", "true") | |
self.set_header("Access-Control-Allow-Origin", "") | |
self.set_header("Access-Control-Allow-Methods", "GET, POST") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd my-repo | |
git fetch upstream | |
git checkout --detach upstream/master | |
git pull --no-commit upstream refs/pull/<pr-id>/head | |
# local repo now has (uncommited) changes from pull request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# pre-commit git hook to make sure developers don't accidentally commit code they didn't mean to commit :) | |
REMOVEME_STRING="REMOVEME" | |
DEBUGGER_STRING="debugger" | |
ALLOW_COMMITTING_REMOVEME=`git config hooks.allowcommittingremoveme` | |
# redirect stdout to stderr | |
exec 1>&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Open the file directly in the browser and run this script from the console | |
//Assumptions: The browser uses a <pre/> tag for showing the CSS code | |
var file = document.querySelector("pre"); | |
var fileContent = file.innerHTML; | |
var newContent = fileContent.replace(/([\d.]+)(px)/g, function(m){ | |
var measure = parseFloat(m.split("px")[0]); | |
var newMeasure = measure / 10; | |
newMeasure = newMeasure.toFixed(2); | |
newMeasure = newMeasure.replace(/(\.[0-9]*?)0+$/, "$1"); // remove trailing zeros |