Skip to content

Instantly share code, notes, and snippets.

View justquick's full-sized avatar
⚙️
Contemplating the Infinite

Justin Quick justquick

⚙️
Contemplating the Infinite
View GitHub Profile
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
@justquick
justquick / cached_property.py
Created December 19, 2022 05:05
from python 3.8.6
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
<!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);
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/',
@justquick
justquick / fabfile.py
Created October 11, 2010 18:58
Ubuntu update manager for Fabric. Checks for updates, installs them and reboots if needed across multiple servers
"""
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
@justquick
justquick / git-r
Created September 20, 2011 15:32
GIT-R-DONE!
#!/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
@justquick
justquick / gist:3249273
Created August 3, 2012 16:33
twitter logging example using werkzeug's reloader
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
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'
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
@justquick
justquick / GFKManager.py
Created September 12, 2011 05:12 — forked from dexterbt1/GFKManager.py
django generic foreignkey manager
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.
"""