I hereby claim:
- I am darland on github.
- I am darland (https://keybase.io/darland) on keybase.
- I have a public key ASD6L-L39b-q91U1UDBMBjFcur7a0HtEXH8Na4Xj0XpFBAo
To claim this, I am signing this object:
| -- Accepted answer from here: https://stackoverflow.com/questions/5408156/how-to-drop-a-postgresql-database-if-there-are-active-connections-to-it | |
| SELECT pg_terminate_backend(pg_stat_activity.pid) | |
| FROM pg_stat_activity | |
| WHERE pg_stat_activity.datname = '[your database name goes here]' | |
| AND pid <> pg_backend_pid(); |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| # | |
| # This is how I used it: | |
| # $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history | |
| import sys | |
| import time |
| package example | |
| type User struct { | |
| ID string | |
| Email string | |
| } | |
| type SomeAPIClient interface { | |
| GetUser(usedId string) (*User, error) | |
| } |
| if input volume of (get volume settings) = 0 then | |
| set level to 90 | |
| display notification "On" with title "Mic" | |
| tell application "System Events" | |
| tell appearance preferences | |
| set dark mode to false | |
| end tell | |
| end tell | |
| else | |
| set level to 0 |
| #!/bin/bash | |
| # Expects Ubuntu 16.06 (xenial) and kernel 4.x. | |
| # Based upon a blog post by Zach at http://zachzimm.com/blog/?p=191 | |
| set -eux | |
| # Have the user call sudo early so the credentials is valid later on | |
| sudo whoami |
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import json | |
| import argparse | |
| from jinja2 import Environment, FileSystemLoader | |
| template = '[{{timestamp}}] {{fields.level}} {{message}}' | |
| t = Environment().from_string(template) |