Skip to content

Instantly share code, notes, and snippets.

View jnewman's full-sized avatar

Joshua Newman jnewman

View GitHub Profile
from flask import Flask, make_response
app = Flask(__name__)
@app.route('/no-space')
def no():
return make_response(('Hello', 200, {'Content-Disposition': 'attachment; filename=hello.txt'}))
body {
white-space: pre;
font-family: monospace;
background-color: rgb(45, 45, 100);
color: rgb(200, 150, 100);
}
.property {
font-weight: bold;
}
@jnewman
jnewman / app.py
Created September 12, 2014 18:21
Reproduce issue in Firebug network tab
from datetime import datetime
from flask import Flask, render_template, request, make_response
from argparse import ArgumentParser
app = Flask(__name__)
DEFAULT_HOST = 'example.com'
app.config['HOST'] = DEFAULT_HOST
@app.route('/cookies')
var offset = 0;
var decodeChar = function (char, on) {
var code = char.charCodeAt() - 64;
var out = '';
while (code-- > 0) {
out += offset++ % 80 === 0 ? '\n' : (on ? '!' : ' ');
}
return out;
};
@jnewman
jnewman / unassigned-red.js
Last active December 16, 2015 02:49
Makes pivotal issues that're not assigned red.
javascript:[].forEach.call(document.querySelectorAll('.story'),function(n){if(!n.querySelector('.owner')){console.info(n);n.style.color='#f00'}});