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 | |
from urllib.parse import urlparse | |
from typing import Iterator | |
from bravado.requests_client import RequestsClient | |
from bravado.client import SwaggerClient | |
class lakeFSResolver(object): | |
""" | |
An example lakeFS client that allows resolving |
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
lakeFS Individual Contributor License Agreement | |
Adapted from http://www.apache.org/licenses/ © Apache Software Foundation | |
Thank you for your interest in lakeFS (the "Foundation"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Foundation must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Foundation and its users; it does not change your rights to use your own Contributions for any other purpose. If you have not already done so, please complete and sign, then scan and email a pdf file of this Agreement to [email protected] | |
Please read this document carefully before signing and keep a copy for your records. | |
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Foundation. In return, the Foundation |
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
### Keybase proof | |
I hereby claim: | |
* I am ozkatz on github. | |
* I am ozk (https://keybase.io/ozk) on keybase. | |
* I have a public key whose fingerprint is 1AB0 E63A 96C0 217D 04EB 70A7 71DF 2351 5439 C3A1 | |
To claim this, I am signing this object: |
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 urllib2 | |
import multiprocessing | |
import sqlite3 | |
# With this line in place, calling urlopen() below | |
# will simply hang on OSX 10.9.1 (Python 2.7.5) | |
# comment the line out and urlopen() works as it should. | |
c = sqlite3.connect('/tmp/some.db') |
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
# Add this to your fabfile.py (or import it from there) | |
from boto.ec2.connection import EC2Connection | |
class EC2Resolver(object): | |
AWS_KEY_ID = 'xxxxxxx' | |
AWS_SECRET_ACCESS_KEY = 'xxxxxx' # Alternitavely take this info from environment variables or some other resource. | |
def __init__(self): |
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 os | |
import sys | |
import argparse | |
try: | |
from boto.ec2.connection import EC2Connection | |
except ImportError: | |
sys.stderr.write('Please install boto ( http://docs.pythonboto.org/en/latest/getting_started.html )\n') | |
sys.exit(1) |
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 random import shuffle | |
def is_ordered(l): | |
for i, x in enumerate(l): | |
if i == 0: | |
continue | |
if x < l[i - 1]: | |
return False | |
return True |
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 django.conf import settings | |
from django.core.mail import EmailMultiAlternatives | |
from django.template.loader import render_to_string | |
class EMail(object): | |
""" | |
A wrapper around Django's EmailMultiAlternatives | |
that renders txt and html templates. | |
Example Usage: |
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 os; [ os.system('say %d bottles of beer on the wall, %d bottles of beer, if one of those bottles should happen to fall, %s bottles of beer on the wall' % (99 - i, 99 - i , 99 - i - 1)) for i in range(0, 99) ] |