This file contains hidden or 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
.hound.yml | |
.jscsrc | |
.jshintignore | |
.jshintrc | |
^h/css/ | |
^h/images/ | |
^h/js/ | |
^h/lib/ | |
^h/sass/ | |
^h/static/ |
This file contains hidden or 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
function page(path, callback) { | |
if (window.location.pathname === path) { | |
document.addEventListener('DOMContentLoaded', callback, false); | |
} | |
} |
This file contains hidden or 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
diff --git a/h/api/models/annotation.py b/h/api/models/annotation.py | |
index 87d5b33..353e8f0 100644 | |
--- a/h/api/models/annotation.py | |
+++ b/h/api/models/annotation.py | |
@@ -5,11 +5,12 @@ from __future__ import unicode_literals | |
from pyramid import security | |
import sqlalchemy as sa | |
from sqlalchemy.dialects import postgresql as pg | |
+from sqlalchemy.ext.associationproxy import association_proxy | |
+from sqlalchemy.ext.hybrid import hybrid_property |
This file contains hidden or 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
from pyramid.authentication import SessionAuthenticationPolicy | |
from pyramid.interfaces import IAuthenticationPolicy | |
from zope.interface import implementer | |
... | |
@implementer(IAuthenticationPolicy) | |
class AuthenticationPolicy(object): |
This file contains hidden or 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
#!/usr/bin/env python2 | |
import argparse | |
import elasticsearch | |
import json | |
def get_from_ids(host, port, index, type, ids): | |
es = elasticsearch.Elasticsearch([{'host': host, 'port': port}]) |
This file contains hidden or 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
def lfsr17(key): | |
if len(key) != 17: | |
raise TypeError('need 17 bits of init state') | |
register = key | |
while True: | |
# x^17 ^ x^14 ^ 1 | |
nextbit = int(register[0], 2) ^ int(register[3], 2) ^ 1 | |
register = register[1:] + str(nextbit) | |
yield int(register[0], 2) |
This file contains hidden or 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
#!/usr/bin/env python2 | |
import argparse | |
import elasticsearch | |
from elasticsearch import helpers | |
def migrate_annotations(host, port, index, group_hashid, group_pubid): | |
es = elasticsearch.Elasticsearch([{'host': host, 'port': port}]) |
This file contains hidden or 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
diff --git a/h/static/styles/help-page.scss b/h/static/styles/help-page.scss | |
index 890548c..a6a9c6f 100644 | |
--- a/h/static/styles/help-page.scss | |
+++ b/h/static/styles/help-page.scss | |
@@ -3,9 +3,10 @@ | |
$base-font-size: 16px; | |
$base-line-height: 22px; | |
-@import 'reset'; | |
-@import 'common'; |
This file contains hidden or 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
from wsgiref.simple_server import demo_app | |
def make_app(global_config, **local_config): | |
return demo_app |
This file contains hidden or 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
from wsgiref.simple_server import demo_app | |
def make_app(global_config, **local_config): | |
return demo_app |