I use a GPG key to sign my git commits.
An error like this one might be a sign of an expired GPG key.
error: gpg failed to sign the data fatal: failed to write commit object
import sqlparse | |
qs = MyObject.objects.filter(foo='bar', baz__startswith='baz') | |
sql, params = qs.query.sql_with_params() | |
print sqlparse.format(str(sql % params), | |
reindent=True, keyword_case='upper') |
import React from "react"; | |
const context = React.createContext(); | |
export function QueryClientProvider({ children, client }) { | |
React.useEffect(() => { | |
const onFocus = () => { | |
client.queries.forEach((query) => { | |
query.subscribers.forEach((subscriber) => { | |
subscriber.fetch(); |
fail_fast: true | |
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v4.4.0 | |
hooks: | |
- id: check-added-large-files | |
args: ['--maxkb=500'] | |
- id: fix-byte-order-marker | |
- id: check-case-conflict |
# Use bash syntax | |
SHELL := /bin/bash | |
ARG := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS)) | |
TARGETS_WITH_ARGS = help | |
.PHONY: TARGETS_WITH_ARGS | |
.DEFAULT_GOAL := help | |
## -- Help -- |
A git choose-your-own-adventure!
This document is an attempt to be a fairly comprehensive guide to recovering from what you did not mean to do when using git. It isn't that git is so complicated that you need a large document to take care or your particular problem, it is more that the set of things that you might have done is so large that different techniques are needed depending on exactly what you have done and what you want to have happen.
from one_session_per_user.models import User, Visitor | |
from django.contrib.sessions.models import Session | |
class OneSessionPerUserMiddleware(object): | |
"""http://stackoverflow.com/a/1814797""" | |
def process_request(self, request): | |
if isinstance(request.user, User): | |
current_key = request.session.session_key |
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |