I hereby claim:
- I am defrex on github.
- I am defrex (https://keybase.io/defrex) on keybase.
- I have a public key whose fingerprint is 1486 B752 395C B552 C0DF 8604 D2BB 926C 932E D7E4
To claim this, I am signing this object:
$(document).bind('ajaxError', function(e, jqXHR){ | |
if (jqXHR.status == 500){ | |
var erframe = document.createElement('iframe'); | |
$('body').append(erframe); | |
$(erframe).css({ | |
'position': 'absolute', | |
'top': '5%', 'left': '50%', | |
'width': '90%', 'height': '90%', | |
'marginLeft': '-45%' | |
}).attr('id', 'errorframe'); |
def pretty_request(request): | |
headers = '' | |
for header, value in request.META.items(): | |
if not header.startswith('HTTP'): | |
continue | |
header = '-'.join([h.capitalize() for h in header[5:].lower().split('_')]) | |
headers += '{}: {}\n'.format(header, value) | |
return ( |
import markdown as mkdn | |
from django import template | |
from django.utils.safestring import mark_safe | |
register = template.Library() | |
@register.filter() | |
def markdown(value): |
function parseUrl(url) { | |
var urlParser = document.createElement('a'); | |
urlParser.href = url; | |
return { | |
hostname: urlParser.hostname, | |
pathname: urlParser.pathname, | |
search: urlParser.search, | |
hash: urlParser.hash, | |
port: urlParser.port, |
I hereby claim:
To claim this, I am signing this object:
from storages.backends.s3boto import S3BotoStorage | |
class StaticS3BotoStorage(S3BotoStorage): | |
location = 'static' | |
class MediaS3BotoStorage(S3BotoStorage): | |
location = 'media' |
from django.core.management.commands.shell import Command as ShellCommand | |
class Command(ShellCommand): | |
shells = ['ptpython', 'ipython', 'bpython'] | |
def ptpython(self): | |
from prompt_toolkit.contrib.repl import embed | |
embed(globals(), locals(), vi_mode=False, history_filename=None) |
from __future__ import unicode_literals, print_function | |
import re | |
import colorama | |
header_regex = re.compile('^HTTP_') | |
def print_header(key, value): |
{ | |
"title": "Spendwell JS Test", | |
"posts": [ | |
{ | |
"title": "Power", | |
"gif": "http://i.giphy.com/WmDxBPSHdEBtS.gif" | |
}, | |
{ | |
"title": "Disgusting", | |
"text": "http://i.giphy.com/xThuWgQbkshXOAlUHu.gif" |
import { subDays, subWeeks } from 'date-fns' | |
import { Repitition } from './Repitition' | |
describe('Repitition', () => { | |
test('findByDate', async () => { | |
const base = new Date() | |
const twoWeeksAgo = subWeeks(base, 2) | |
const twoWeeksOneDayAgo = subDays(twoWeeksAgo, 1) | |
const weeklyStartingTwoWeeksAgo = await Repitition.create({ |