Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
def get_count(q): | |
count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
count = q.session.execute(count_q).scalar() | |
return count | |
q = session.query(TestModel).filter(...).order_by(...) | |
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
print q.count() |
// Giant List of Negative Porn Keywords To Exclude From Google Adwords | |
adult film | |
adult movie | |
adult video | |
anal | |
ass | |
bara | |
barely legal | |
bdsm | |
bestiality |
-- | |
-- ** setting up example tables and data ** | |
-- | |
-- | |
CREATE TABLE task ( | |
id BIGSERIAL , | |
name TEXT, | |
parent_id BIGINT REFERENCES task(id), | |
PRIMARY KEY (id) |
import logging | |
from termcolor import colored | |
class ColorLog(object): | |
colormap = dict( | |
debug=dict(color='grey', attrs=['bold']), | |
info=dict(color='white'), | |
warn=dict(color='yellow', attrs=['bold']), |
from sqlalchemy import create_engine, event, orm | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy.orm.session import Session as SessionBase, object_session | |
from sqlalchemy.event.api import listen | |
# The following adds delete, insert, and update events after successful commits. | |
# SQLAlchemy provides only events after flushes, but not after commits. | |
# The classes are adapted from Flask-SQLAlchemy. | |
# see also https://stackoverflow.com/a/12026787/60982 |
#!/usr/bin/python3 | |
# This script is a simple introduction to the python elasticsearch API. | |
# | |
# This script will populate an elasticsearch index from a file and then give a simple command line query interface. | |
# Each line of the input file will be mapped into a JSON document of the form { "text": "my file line..." } and added | |
# to the index. | |
# | |
# You can use Docker to spin up a local elasticsearch instance to play around with, e.g. | |
# docker run --name elasticsearch -d -p 9200:9200 elasticsearch:latest | |
# |
# This is an example of metaprogramming in the Elixir language. | |
# | |
# We will define a domain specific language (DSL) for the definition | |
# of a service which is watched by several sensors. | |
# Each sensor watches some property/functionality of the service and | |
# returns the result of the check. | |
# | |
# To determine if the service is functioning properly, we need functions | |
# to run all the sensors' code and gather the returned data. | |
# |
/.vscode | |
__pycache__ | |
.pytest_cache | |
log.txt |
#!/bin/sh | |
# encode_bitrate_overlay.sh | |
# | |
# | |
# Created by Andrew Sinclair on 11/07/2014. | |
# | |
#!/bin/bash | |
VIDSOURCE=$1 | |
OUTNAME=$2 |