View replace_domain.py
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
from __future__ import print_function | |
import os | |
import sqlite3 | |
import sys | |
import re | |
_args = sys.argv | |
try: | |
if len(_args) != 3: |
View utcnow.py
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
import sqlalchemy.types | |
from sqlalchemy.sql import expression | |
from sqlalchemy.ext.compiler import compiles | |
class utcnow(expression.FunctionElement): | |
type = sqlalchemy.types.DateTime() | |
@compiles(utcnow) | |
def utcnow__default(element, compiler, **kw): |
View compiler.py
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
@util.memoized_property | |
def _bind_processors(self): | |
return dict( | |
(key, value) | |
for key, value in ( | |
( | |
self.bind_names[bindparam], | |
bindparam.type._cached_bind_processor(self.dialect) | |
if not bindparam._expanding_in_types | |
else tuple( |
View test_invalidate.py
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
from __future__ import print_function | |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
# | |
# Use this file to build your own SSCCE | |
# SSCCE = Short, Self Contained, Correct (Compatible) Example | |
# see http://sscce.org/ | |
# | |
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
View encodings_test.py
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
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
""" | |
This test harness showcases an odd scenario when providing compatibility | |
with Python2 and Python3 data. | |
The input to a function is a URL, which in Python2 might have been: | |
url_unicode = u'http://➡.ws/♥' | |
url_string = 'http://\xe2\x9e\xa1.ws/\xe2\x99\xa5' |
View amp_img_upgrade.py
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
import re | |
RE_img = re.compile("""<img[^>]+>""", re.I) | |
def upgrade( | |
html, | |
img_layout=None, # STRING | |
img_fallback=None, # STRING | |
img_noscript=None, # BOOL | |
img_noloading=None, # BOOL | |
img_default_height=None, # must be a STRING, never an INT |
View wellformed_parser.py
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
def extract_tag_inner(tag): | |
""" | |
extracts the inner part of a tag - dropping brackets, tagname, trailing slash | |
:arg string tag: a html tag of the formats: | |
<TAG_NAME TAG_ATTRIBUTES> | |
<TAG_NAME TAG_ATTRIBUTES/> | |
<TAG_NAME TAG_ATTRIBUTES /> | |
:returns string: the inner part of a tag |
View shame.py
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
def foo(): | |
# i am awful for doing this. | |
# this function has a nested function, which can not accept arguments | |
# the inner function will be called twice by a 3rd party library | |
iteration = [0, ] # use a list as a shameful hack to get around scoping issues | |
def bar(): | |
iteration[0] += 1 # increment the list index, use that for comparison | |
if iteration[0] > 1: |
View dogpile.py
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
""" | |
The following are some code snippets on how i optimized a system using Dogpile cache into native Redis, while still leveraging dogpile. | |
This is not fully functional code, it's just snippets to explain and help the next person: | |
General Overview: | |
* The cached data is a computed value of multiple permissions for an A2B relation. | |
* The Redis key is `'calculated-a|%s' % id_a`. | |
* The payload is stored in a field, via `id_b`. |
View email.txt
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
It's your data. | |
It's our responsibility to protect it. | |
As a new data protection regulation goes into effect in Europe, we are taking the opportunity to make improvements for all 23andMe customers globally. On May 24, 2018, we launched important privacy updates and new tools as part of our ongoing commitment to ensure that you are in control of your data. | |
We updated our Privacy Statement with additional information about our practices and made it easier to understand. | |
https://www.23andme.com/about/privacy/ | |
We created a Data Protection Center to help explain the European Union's new regulation and provide information about our approach to compliance. | |
https://www.23andme.com/gdpr/ | |
We added information to our website regarding our security practices and the measures we put in place to protect your data. |
NewerOlder