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
PREFECT_API_DATABASE_CONNECTION_URL="postgresql+asyncpg://prefect:prefect@localhost:5432/prefect" | |
PREFECT_LOGGING_SERVER_LEVEL=DEBUG | |
PREFECT_LOGGING_LEVEL=DEBUG | |
PREFECT_LOGGING_INTERNAL_LEVEL=DEBUG |
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 cached_property: | |
def __init__(self, func): | |
self.func = func | |
self.attrname = None | |
self.__doc__ = func.__doc__ | |
self.lock = RLock() | |
def __set_name__(self, owner, name): | |
if self.attrname is None: | |
self.attrname = name |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<style> | |
@font-face { | |
font-family: Fira Sans; | |
font-weight: 500; | |
src: url(http://fonts.gstatic.com/s/firasans/v11/va9E4kDNxMZdWfMOD5VfkILKSTbndQ.ttf); |
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 haystack | |
from django.core.management import call_command | |
from django.test.utils import override_settings | |
TEST_INDEX = { | |
'default': { | |
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', | |
'URL': 'http://127.0.0.1:9200/', |
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
""" | |
Ubuntu update manager for Fabric | |
Checks for updates, installs them and reboots if needed across multiple servers | |
Create a "hosts" file alongside this fabfile and put your hosts in there one per line | |
Updating package list:: | |
fab update |
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
#!/bin/bash | |
if [ $1 = "done" ] | |
then | |
python -c 'import webbrowser; webbrowser.open("http://images.cheezburger.com/completestore/2010/9/13/43852ca1-5252-45de-84b9-10c5b0ce4e43.jpg")' | |
fi |
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 | |
import sys | |
import signal | |
import json | |
import requests | |
from subprocess import call | |
from time import time, sleep | |
from itertools import chain | |
try: | |
from urllib import urlopen |
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 time | |
import gdata.spreadsheet.service | |
import requests | |
import sys | |
client = gdata.spreadsheet.service.SpreadsheetsService() | |
client.email = 'XXX@gmail.com' | |
client.password = 'XXX' | |
client.source = 'Example Spreadsheet Writing Application' |
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
Install - OSX 10.6, Python 2.6.1 django-lint git clone | |
Installed /Library/Python/2.6/site-packages/django_lint-0.0.0-py2.6.egg | |
Processing dependencies for django-lint==0.0.0 | |
Searching for pylint==0.25.0 | |
Best match: pylint 0.25.0 | |
Adding pylint 0.25.0 to easy-install.pth file | |
Using /Library/Python/2.6/site-packages | |
Searching for logilab-astng==0.23.0 |
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.db.models.query import QuerySet | |
from django.db.models import Manager | |
from django.contrib.contenttypes.models import ContentType | |
from django.contrib.contenttypes.generic import GenericForeignKey | |
class GFKManager(Manager): | |
""" | |
A manager that returns a GFKQuerySet instead of a regular QuerySet. | |
""" |
NewerOlder