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
query LIST_ALL_MEMBERS( | |
$chapter_id: Int!, | |
$limit: Int = 20, | |
$offset: Int = 0 | |
) { | |
users:chapter_members( | |
where: { | |
_and: [ | |
{chapter_id: {_eq: $chapter_id}}, | |
{is_chapter_organizer: {_eq: false}} |
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
class AccessorDict(dict): | |
def __getitem__(self, key): | |
"""Handle access like foo['bar'] | |
Wrap any raw dicts in new AccessorDict instances | |
""" | |
out = super(AccessorDict, self).__getitem__(key) | |
if isinstance(out, dict): | |
out = AccessorDict(out) | |
return out |
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
#!/usr/bin/env python | |
import sys | |
import string | |
from collections import deque, defaultdict | |
def findTerm( search, text ): | |
# Unique set of search terms (lowercase) | |
terms = set( s for s in search.lower().split(" ") ) |
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
#!/usr/bin/env python | |
"""phrase_finder.py | |
Find the shortest segment of haystack text containing ALL of the needle words | |
SOME LICENSE BLAH BLAH... | |
Author: Trey Stout <treystout@gmail.com> | |
""" | |
import collections |
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
#!/usr/bin/env python | |
"""phrase_finder.py | |
Find the shortest segment of haystack text containing ALL of the needle words | |
SOME LICENSE BLAH BLAH... | |
Author: Trey Stout <treystout@gmail.com> | |
""" | |
import itertools |
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
604 19:56:24 vagrant@trey-vagrant [~/real_outland] J:0 (outland_env) [back_to_sql] ⎆ cat regex.yaml | |
regex: '[a-z0-9\.-_]' | |
605 19:56:28 vagrant@trey-vagrant [~/real_outland] J:0 (outland_env) [back_to_sql] ⎆ bpython | |
>>> import re, yaml | |
>>> y = yaml.load(open('regex.yaml')) | |
>>> y | |
{'regex': '[a-z0-9\\.-_]'} | |
>>> r = re.compile(y['regex']) | |
>>> r.match('trey') | |
<_sre.SRE_Match object at 0x21a2d98> |
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
#!/usr/bin/env python | |
"""This script simply renders a message as a pdf and saves it to a file | |
(out.pdf) in the working directory | |
""" | |
import os | |
import sys | |
try: | |
import requests |
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
diff -r ffa320b5e178 web/site/auth.py | |
--- a/web/site/auth.py Thu Nov 29 15:47:01 2012 -0500 | |
+++ b/web/site/auth.py Fri Nov 30 16:41:17 2012 -0500 | |
@@ -5,12 +5,11 @@ | |
Date Added: Fri Mar 23 20:08:15 PDT 2012 | |
""" | |
import logging | |
+from functools import partial | |
-from flask import request as R, render_template as T, redirect, flash, \ |
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
#!/usr/bin/env python | |
import hashlib | |
import lib.akn.config as cfg | |
cfg.init(False) | |
from lib.akn.exceptions import CallError | |
def __zset_fetch(bind_pairs, start=0, end=29, count=False, | |
reverse=True, ids_only=False, operator="union", ttl=0, **kwargs): | |
"""General purpose tool for doing zset traversal in redis without abusing | |
local memory too much. To call it, you send in pairs consisting of |
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
#!/usr/bin/env python | |
import lib.akn.config as cfg | |
cfg.init(False) | |
from lib.akn.exceptions import CallError | |
def __zset_fetch(bind_pairs, start=0, end=29, count=False, | |
reverse=True, ids_only=False, operator="union", **kwargs): | |
"""General purpose tool for doing zset traversal in redis without abusing | |
local memory too much. To call it, you send in pairs consisting of | |
* a string representing a zset's key |
NewerOlder