Skip to content

Instantly share code, notes, and snippets.

View dcramer's full-sized avatar
💭
I may be slow to respond.

David Cramer dcramer

💭
I may be slow to respond.
View GitHub Profile
@dcramer
dcramer / gist:5537828
Last active December 17, 2015 02:39
- 2 runs, one warmup, one timed
- warmup was 5m
- timed run 30s
- default sentry settings (no database access)
- 3 sync workers
- sentry start
- os-x (brew install pypy --devel)
- siege -c 3 http://localhost:9000/login/ -b -t30S
== pypy 2.0 beta 2
# pypy
100 requests serviced in 17.763s
avg of 0.178s/req, 5 req/s
real 0m27.111s
user 0m22.705s
sys 0m0.646s
# python2.7
from django.contrib.auth.hashers import BCryptPasswordHasher
from django.utils.crypto import constant_time_compare
from django.utils.encoding import force_bytes
class DjangoBCryptPasswordHasher(BCryptPasswordHasher):
"""
Handles legacy passwords wich were hashed with the 'bc$' algorithm via
django-bcrypt.
"""
dcramer:tenxer in ~/Development/tenxer on git:master+
$ arc lint --trace
libphutil loaded from '/usr/local/include/php/libphutil/src'.
arcanist loaded from '/usr/local/include/php/arcanist/src'.
Loading phutil library from '/usr/local/include/php/libdisqus/src'...
>>> [0] <exec> $ git rev-parse --show-cdup
<<< [0] <exec> 6,196 us
@dcramer
dcramer / gist:5406525
Last active December 16, 2015 08:29
$9 personal account, 3k / day (no team members)
$24 for 7.5k / day
$79 for 25k / day
$299 for 100k / day
an exception with a stacktrace is ~5kb in storage (excluding giant ruby/java exceptions that can go over those bounds easily)
- all plans have unlimited projects
- SLAs on any pricetag over $200?
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
self.run()
File "/var/lib/jenkins/workspace/build/env/local/lib/python2.7/site-packages/paramiko/agent.py", line 116, in run
self._communicate()
File "/var/lib/jenkins/workspace/build/env/local/lib/python2.7/site-packages/paramiko/agent.py", line 126, in _communicate
events = select([self._agent._conn, self.__inr], [], [], 0.5)
TypeError: argument must be an int, or have a fileno() method.
from gevent import Greenlet
class Config(object):
def __init__(self):
self.url = 'http://localhost:9000/'
self.timeout = 5
class EventLoop(Greenlet):
<style type="text/css">
* {
font-family: 'Open Sans', Helvetica, 'Bitstream Vera Sans', Arial, Verdana, sans-serif;
}
body {
font-size: 12px;
}
a {
color: #000;
def missing_access(request, perm_name, *args):
resp = plugins.first('missing_access_response', request, perm_name, *args)
if resp:
return resp
return HttpResponseRedirect(reverse('sentry'))
@csrf_protect
@has_access(MEMBER_OWNER)
def create_new_team_project(request, team):
<style type="text/css">
* {
font-family: 'Open Sans', Helvetica, 'Bitstream Vera Sans', Arial, Verdana, sans-serif;
}
.container {
width: 600px;
border: 1px solid rgb(182, 201, 212);
}
h1 {
font-weight: bold;