I hereby claim:
- I am frankwiles on github.
- I am frankwiles (https://keybase.io/frankwiles) on keybase.
- I have a public key whose fingerprint is 782D A1E3 A547 E219 FD44 C7A0 BDE8 83DD D590 08CA
To claim this, I am signing this object:
from django.db import models | |
from app1.models import ModelOne | |
from app2.models import ModelTwo | |
class ThingInThisApp(models.Model): | |
one = models.ForeignKey(ModelOne, related_name="things", on_delete.models.CASCADE) | |
two = models.ForeignKey(ModelTwo, related_name="things", on_delete.models.CASCADE) | |
# ... |
from tasks.models import * | |
t = Task.objects.create(name="Test1") | |
s1 = Step.objects.create(task=t, name="Testing1") | |
s2 = Step.objects.create(task=t, name="Testing2") | |
s3 = Step.objects.create(task=t, name="Testing3") | |
s4 = Step.objects.create(task=t, name="Testing4") | |
# Show the existing numbers/structure |
I hereby claim:
To claim this, I am signing this object:
from logbook import Logger, FileHandler | |
FileHandler('./output.log').push_application() | |
log = Logger('my-example-logger') | |
log.info("Testing") | |
# Output in ./output.log | |
# [2016-05-19 20:53:53.095826] INFO: my-example-logger: Testing |
from django.utils.safestring import mark_safe | |
from markdown import markdown | |
from pygments import highlight | |
from pygments.formatters import get_formatter_by_name | |
from pygments.lexers import get_lexer_by_name | |
from wagtail.wagtailcore import blocks | |
class CodeBlock(blocks.StructBlock): |
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>*</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>HEAD</AllowedMethod> | |
<MaxAgeSeconds>3000</MaxAgeSeconds> | |
<AllowedHeader>Authorization</AllowedHeader> | |
</CORSRule> | |
</CORSConfiguration> |
# Execute these commands in order to rebuild a virtualenv from scratch | |
$ heroku labs:enable user-env-compile | |
$ heroku config:set CLEAN_VIRTUALENV=yes | |
$ heroku config:set VIRTUALENV_DIRS=.heroku/venv | |
$ git push heroku master | |
$ heroku config:unset CLEAN_VIRTUALENV | |
$ heroku config:unset VIRTUALENV_DIRS | |
$ heroku labs:disable user-env-compile |
CREATE TABLE song ( | |
title varchar(20), | |
); | |
CREATE INDEX firstfive_idx ON song WHERE substring(title, 0, 6); | |
SELECT * FROM song WHERE substring(title, 0, 6) = 'foobar1' AND title='foobar1bazbazwheeheee!'; |
highlight ExtraWhitespace ctermbg=red guibg=red | |
match ExtraWhitespace /\s\+$/ | |
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ | |
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ | |
autocmd InsertLeave * match ExtraWhitespace /\s\+$/ | |
autocmd BufWinLeave * call clearmatches() |
[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\ | |
xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xf | |
f\n\015()]*)*\)[\040\t]*)*(?:(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\x | |
ff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015 | |
"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[\040\t]*(?:\([^\\\x80-\ | |
xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80 | |
-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]* | |
)*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\ | |
\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\ | |
x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x8 |